/* Kidzcare Preschool - Admin Portal Styles */

:root {
  --primary: #ff5c77;
  --primary-hover: #e84360;
  --secondary: #3bb4f2;
  --dark: #2d3436;
  --gray-dark: #636e72;
  --gray-light: #f1f2f6;
  --white: #ffffff;
  --sidebar-bg: #1e2430;
  --content-bg: #f5f6fa;
  --border-color: #e4e7eb;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--dark);
  background-color: var(--content-bg);
  min-height: 100vh;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h2 {
  font-family: 'Fredoka', cursive;
  font-size: 1.5rem;
  line-height: 1.1;
}

.sidebar-brand h2 span {
  color: var(--primary);
}

.sidebar-brand small {
  color: #a4b0be;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.25s ease;
  font-family: 'Nunito', sans-serif;
}

.nav-btn i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #ff9f43);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 92, 119, 0.35);
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-return-site {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffeaa7;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-return-site:hover {
  color: #fff;
  transform: translateX(-3px);
}

/* MAIN CONTENT */
.main-content {
  flex-grow: 1;
  padding: 24px 30px;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar-left h1 {
  font-family: 'Fredoka', cursive;
  font-size: 1.8rem;
  color: #2f3542;
}

.campus-sub {
  font-size: 0.85rem;
  color: var(--gray-dark);
  margin-top: 2px;
}

.campus-sub i {
  color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-badge {
  background: #e1f5fe;
  color: #0288d1;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-user-badge {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
}

.admin-user-badge i {
  color: var(--primary);
}

/* TABS */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* METRICS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.metric-card {
  padding: 22px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.bg-card-pink { background: linear-gradient(135deg, #fff0f3, #ffe3e8); border-left: 5px solid #ff5c77; }
.bg-card-blue { background: linear-gradient(135deg, #e8f4fd, #d7edfc); border-left: 5px solid #3bb4f2; }
.bg-card-green { background: linear-gradient(135deg, #e8f8f5, #d1f2eb); border-left: 5px solid #1dd1a1; }
.bg-card-orange { background: linear-gradient(135deg, #fff5eb, #ffebd7); border-left: 5px solid #ff9f43; }

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--dark);
}

.metric-details {
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-dark);
}

.metric-details h3 {
  font-family: 'Fredoka', cursive;
  font-size: 1.6rem;
  color: var(--dark);
  line-height: 1.2;
}

.metric-details small {
  font-size: 0.75rem;
  color: #747d8c;
}

/* PANELS */
.dashboard-split {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
}

.panel-box {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h3 {
  font-family: 'Fredoka', cursive;
  font-size: 1.25rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-btn {
  background: #f8f9fe;
  border: 1px solid #e1e8f0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.25s;
}

.quick-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

/* TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 800;
  color: #57606f;
  border-bottom: 2px solid #eaedf0;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid #eaedf0;
  color: #2f3542;
}

.data-table tr:hover {
  background-color: #fdfdfe;
}

/* STATUS BADGES */
.badge-present {
  background: #e8f8f5;
  color: #16a085;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-block;
}

.badge-absent {
  background: #ffebee;
  color: #c0392b;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-block;
}

.badge-leave {
  background: #fff8e1;
  color: #f39c12;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-block;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: 'Nunito', sans-serif;
  transition: all 0.25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #ff9f43);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 92, 119, 0.35);
}

.btn-secondary {
  background: #e4e7eb;
  color: #2f3542;
}

.btn-secondary:hover {
  background: #dcdde1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* FORMS */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #4b6584;
  margin-bottom: 6px;
}

input, select, textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Nunito', sans-serif;
  background: #fdfdfe;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ATTENDANCE BAR */
.attendance-summary-bar {
  background: #f8f9fa;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.text-green { color: #16a085; }
.text-red { color: #e74c3c; }
.text-orange { color: #f39c12; }
.text-primary { color: var(--primary); }

.attendance-control-panel {
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.btn-align-bottom {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
}

/* FEE MODULE */
.fee-two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 25px;
}

.fee-heads-list {
  background: #f8f9fa;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.fee-head-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.fee-head-item input {
  width: 110px;
  text-align: right;
  padding: 6px 10px;
}

.discount-item {
  color: #e74c3c;
}

.fee-total-row {
  border-top: 2px dashed #ced6e0;
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--primary);
}

/* PRINTABLE RECEIPT */
.printable-receipt {
  background: #fff;
  border: 2px solid #2f3542;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  color: #2f3542;
}

.receipt-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #2f3542;
  padding-bottom: 14px;
  margin-bottom: 12px;
}

.receipt-title-box h2 {
  font-family: 'Fredoka', cursive;
  font-size: 1.35rem;
  color: #ff5c77;
  letter-spacing: 0.5px;
}

.receipt-title-box p {
  font-size: 0.85rem;
  font-weight: 700;
}

.receipt-title-box small {
  font-size: 0.75rem;
  color: #57606f;
}

.receipt-badge-bar {
  background: #f1f2f6;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 16px;
  border-radius: 4px;
}

.receipt-student-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  background: #fafbfc;
  padding: 10px;
  border-radius: 4px;
}

.receipt-breakdown {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.receipt-breakdown th {
  background: #eaedf0;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-bottom: 1px solid #ced6e0;
}

.receipt-breakdown td {
  padding: 8px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f2f6;
}

.receipt-total-row td {
  border-top: 2px solid #2f3542;
  font-size: 0.95rem;
  color: #000;
}

.receipt-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 25px;
}

.receipt-note {
  max-width: 60%;
  font-size: 0.75rem;
  color: #747d8c;
}

.receipt-sign {
  text-align: center;
}

.sign-line {
  width: 140px;
  height: 1px;
  background: #2f3542;
  margin: 0 auto 6px;
}

.receipt-sign span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
}

.receipt-sign small {
  font-size: 0.7rem;
  color: #747d8c;
}

/* STUDENT ID BADGE */
.idcard-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.student-id-badge {
  width: 280px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  border: 1px solid #dcdde1;
  overflow: hidden;
  text-align: center;
  position: relative;
}

.badge-top-pattern {
  background: linear-gradient(135deg, #ff5c77, #ff9f43);
  padding: 16px 14px 14px;
  color: white;
}

.badge-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.badge-school-name h4 {
  font-family: 'Fredoka', cursive;
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.5px;
}

.badge-school-name span {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.9;
}

.badge-body {
  padding: 16px 18px;
}

.badge-photo-box {
  width: 80px;
  height: 90px;
  background: #f1f2f6;
  border: 3px solid #ff5c77;
  border-radius: 8px;
  margin: -10px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background-color: white;
}

.default-avatar {
  font-size: 2.8rem;
  color: #a4b0be;
}

.badge-student-name {
  font-family: 'Fredoka', cursive;
  font-size: 1.15rem;
  color: #2d3436;
  margin-bottom: 4px;
}

.badge-class-pill {
  background: #ffeaa7;
  color: #d63031;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 12px;
}

.badge-details-grid {
  text-align: left;
  font-size: 0.78rem;
  margin-bottom: 12px;
  background: #fafbfc;
  padding: 10px;
  border-radius: 6px;
}

.b-row {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.b-lbl {
  color: #636e72;
  font-weight: 600;
}

.badge-barcode {
  margin-top: 10px;
  border-top: 1px dashed #dcdde1;
  padding-top: 8px;
}

.barcode-lines {
  font-family: monospace;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: #2d3436;
}

.badge-barcode small {
  font-size: 0.65rem;
  color: #747d8c;
  display: block;
  margin-top: 2px;
}

.badge-footer-ribbon {
  background: #2d3436;
  color: #ffeaa7;
  font-size: 0.7rem;
  padding: 5px;
  font-weight: 700;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 580px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  background: #f8f9fa;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-family: 'Fredoka', cursive;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #a4b0be;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  background: #f8f9fa;
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
}

/* PRINT MEDIA QUERIES */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-receipt, .printable-receipt * {
    visibility: visible;
  }
  .printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: 1px solid #000;
    box-shadow: none;
  }
  .student-id-badge, .student-id-badge * {
    visibility: visible;
  }
  .student-id-badge {
    position: absolute;
    left: 50px;
    top: 50px;
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* RESPONSIVE */
@media (max-width: 992px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .dashboard-split {
    grid-template-columns: 1fr;
  }
  .fee-two-col {
    grid-template-columns: 1fr;
  }
  .idcard-builder-grid {
    grid-template-columns: 1fr;
  }
}
