@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --blue: #1D2671;
  --blue-dark: #12184d;
  --blue-light: #2e3a96;
  --orange: #F27C21;
  --orange-dark: #d76a16;
  --orange-glow: rgba(242, 124, 33, 0.4);
  --bg-color: #f4f7fb;
  
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.5);
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --shadow-sm: 0 4px 10px rgba(29, 38, 113, 0.04);
  --shadow-md: 0 10px 30px rgba(29, 38, 113, 0.08);
  --shadow-lg: 0 20px 40px rgba(29, 38, 113, 0.15);
  --shadow-orange: 0 8px 20px var(--orange-glow);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --radius-md: 12px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text-main);
  background: var(--bg-color);
  font-family: 'Outfit', sans-serif;
  background-image: 
    radial-gradient(circle at 85% 15%, rgba(242, 124, 33, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 15% 85%, rgba(29, 38, 113, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; outline: none; }

/* ---------------------- LOGIN ---------------------- */
.loginPage {
  align-items: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  display: flex;
  min-height: 100vh;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.loginPage::before {
  content: "";
  position: absolute;
  top: -20%; left: -10%; width: 60%; height: 60%;
  background: radial-gradient(circle, var(--orange) 0%, transparent 60%);
  opacity: 0.15;
  filter: blur(80px);
}

.loginShell {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) 420px;
  margin: 0 auto;
  max-width: 1050px;
  width: 100%;
  position: relative;
  z-index: 10;
}

.welcomePanel { align-self: center; color: white; }
.welcomePanel h2 { color: var(--orange); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 10px; font-size: 14px; }
.welcomePanel h1 { font-size: 52px; line-height: 1.1; margin: 0 0 20px; font-weight: 700; }
.welcomePanel p { font-size: 18px; line-height: 1.6; margin: 0; opacity: 0.85; max-width: 500px; }

.loginCard {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: grid;
  gap: 20px;
}

.loginCard h2 { color: white; margin: 0 0 10px; text-align: center; font-weight: 600; font-size: 28px; }
.loginCard label { display: grid; gap: 8px; color: rgba(255, 255, 255, 0.9); font-weight: 500; }
.loginCard input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  height: 48px;
  padding: 0 16px;
  transition: var(--transition);
}
.loginCard input:focus { border-color: var(--orange); background: rgba(255, 255, 255, 0.15); box-shadow: 0 0 0 4px rgba(242, 124, 33, 0.15); }
.loginCard button {
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 600;
  height: 48px;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-orange);
  margin-top: 10px;
}
.loginCard button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 25px var(--orange-glow); }
.loginCard button:disabled { opacity: 0.7; cursor: wait; transform: none; }
.formError { color: #ff6b6b; font-weight: 600; margin: 0; text-align: center; background: rgba(255, 107, 107, 0.1); padding: 10px; border-radius: 6px; }

/* ---------------------- LAYOUT ---------------------- */
.appShell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--blue-dark);
  background: linear-gradient(180deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: #e2e8f0;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.brand {
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  height: 80px;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
}
.brand svg { transition: var(--transition); }
.brand:hover svg { transform: scale(1.05) rotate(5deg); }

.sidebar nav { padding: 20px 0; display: grid; gap: 4px; }

.sidebar button, .sidebar .navButton {
  align-items: center;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 46px;
  padding: 0 24px;
  text-align: left;
  width: 100%;
  font-weight: 500;
  font-size: 15px;
  transition: var(--transition);
  position: relative;
}
.sidebar button::before, .sidebar .navButton::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 4px;
  background: var(--orange); transform: scaleY(0); transition: transform 0.2s ease;
}

.sidebar button:hover, .sidebar .navButton:hover { color: white; background: rgba(255, 255, 255, 0.05); }
.sidebar button.active, .sidebar .navButton.active { color: white; background: rgba(255, 255, 255, 0.08); font-weight: 600; }
.sidebar button.active::before, .sidebar .navButton.active::before { transform: scaleY(1); }

.navGroup { display: grid; }
.dropdownLink {
  background: rgba(0, 0, 0, 0.15) !important;
  color: #94a3b8 !important;
  font-size: 14px;
  min-height: 40px !important;
  padding-left: 54px !important;
  display: flex;
  align-items: center;
}
.dropdownLink:hover { color: white !important; background: rgba(0, 0, 0, 0.25) !important; }
.activeChild {
  color: var(--orange) !important;
  background: rgba(0, 0, 0, 0.3) !important;
  font-weight: 600 !important;
}

.content { padding: 0 32px 40px; min-width: 0; }

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 -32px 30px;
  min-height: 80px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h2 { color: var(--blue-dark); font-size: 20px; font-weight: 700; margin: 0; }

.logoutButton {
  background: rgba(29, 38, 113, 0.05);
  border-radius: 8px;
  color: var(--blue);
  font-weight: 600;
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.logoutButton:hover { background: var(--blue); color: white; box-shadow: var(--shadow-sm); }

/* ---------------------- DASHBOARD ---------------------- */
.summaryGrid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 30px;
}
.metricCard {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  padding: 24px;
  align-items: center;
  transition: var(--transition);
}
.metricCard:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: rgba(255, 255, 255, 0.8); }
.metricIcon {
  align-items: center;
  background: linear-gradient(135deg, rgba(29, 38, 113, 0.1) 0%, rgba(29, 38, 113, 0.02) 100%);
  border-radius: 14px;
  color: var(--blue);
  display: inline-flex;
  height: 60px;
  justify-content: center;
  width: 60px;
}
.metricCard strong { font-size: 28px; font-weight: 700; color: var(--blue-dark); display: block; line-height: 1; margin-bottom: 4px; }
.metricCard span { color: var(--text-muted); font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.statusStrip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: white;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 30px;
  border: 1px solid rgba(0,0,0,0.05);
}
.statusStrip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.statusStrip b {
  background: var(--blue);
  color: white;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
}

/* ---------------------- MODULE FORMS ---------------------- */
.modulePanel { display: grid; gap: 24px; }
.titleLinks { display: flex; flex-wrap: wrap; gap: 8px; background: rgba(255, 255, 255, 0.5); padding: 6px; border-radius: 10px; width: max-content; }
.titleNameLink {
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 8px 16px;
  transition: var(--transition);
  border: none;
}
.titleNameLink:hover { color: var(--blue); }
.activeTitleLink { background: white; color: var(--blue); box-shadow: var(--shadow-sm); }

.entryForm, .registerPanel {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.entryForm h2, .registerPanel h2 { color: var(--blue-dark); font-size: 22px; margin: 0 0 24px; font-weight: 700; }

.formGrid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 30px;
}
.formGrid label, .tableTools label { color: var(--text-main); font-weight: 600; font-size: 14px; display: grid; gap: 8px; }
.formGrid input, .formGrid textarea, .tableTools input, .tableTools select {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  transition: var(--transition);
}
.formGrid input:focus, .formGrid textarea:focus, .tableTools input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 38, 113, 0.1); }
.formGrid textarea { min-height: 100px; padding: 12px 14px; resize: vertical; }

.radioLabel {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  height: 44px;
  font-weight: 600;
  cursor: pointer;
}
.radioLabel input {
  height: 20px;
  width: 20px;
  accent-color: var(--orange);
  cursor: pointer;
  margin: 0;
}

.actionBar { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 24px; }
.submitButton, .smallButton, .dangerButton, .paginationBar button {
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}
.submitButton {
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  min-height: 44px;
  padding: 0 24px;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(29, 38, 113, 0.2);
}
.submitButton:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29, 38, 113, 0.3); }

.smallButton { background: rgba(29, 38, 113, 0.08); color: var(--blue); min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 700; }
.smallButton:hover { background: var(--blue); color: white; }
.dangerButton { background: rgba(255, 107, 107, 0.1); color: #c92a2a; min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 700; }
.dangerButton:hover { background: #c92a2a; color: white; }

.moduleNotice {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin: 20px 0 0;
  display: inline-block;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------- TABLE ---------------------- */
.tablePanel {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.tablePanel h3 { color: var(--blue-dark); font-size: 20px; font-weight: 700; margin: 0 0 20px; }

.tableTools { display: flex; gap: 20px; justify-content: space-between; margin-bottom: 20px; align-items: flex-end; }
.tableTools label { flex-direction: row; align-items: center; gap: 12px; }
.tableTools select, .tableTools input { height: 38px; width: auto; }

.tableScroller {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.05);
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1000px; }
th, td { padding: 14px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid rgba(0,0,0,0.05); white-space: nowrap; }
th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(29, 38, 113, 0.02); }
tbody tr:last-child td { border-bottom: 0; }

.paginationBar { display: flex; gap: 8px; justify-content: flex-end; padding-top: 24px; align-items: center; font-weight: 600; color: var(--text-muted); }
.paginationBar button { background: white; color: var(--text-main); border: 1px solid rgba(0,0,0,0.1); min-height: 36px; padding: 0 14px; }
.paginationBar button:hover:not(:disabled) { background: var(--blue); color: white; border-color: var(--blue); }
.paginationBar button:disabled { opacity: 0.5; background: #f1f5f9; cursor: not-allowed; }

/* ---------------------- RESPONSIVE ---------------------- */
@media (max-width: 980px) {
  .loginShell { grid-template-columns: 1fr; }
  .tableTools { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  .appShell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; max-height: 50vh; }
  .topbar { margin: 0 -20px 20px; padding: 0 20px; }
  .content { padding: 0 20px 20px; }
}
