/* assets/css/style.css - DiKelas Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #d35400;
  --primary-hover: #a04000;
  --primary-light: #fdf2e9;
  --secondary: #e67e22;
  --secondary-hover: #d68910;
  --accent: #f39c12;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #15171c;
  --sidebar-bg-soft: #1c1f26;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: linear-gradient(135deg, #ff7a00 0%, #ff5e3a 100%);
  --sidebar-chip: rgba(255, 255, 255, 0.05);
  --sidebar-active-chip: rgba(255, 255, 255, 0.18);
  --sidebar-text: #aeb4bf;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-radius: 12px;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #818cf8;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --sidebar-width: 260px;
  --header-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--sidebar-bg-soft) 100%);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

.sidebar-brand-box {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.25rem 1.2rem 1.1rem 1.2rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-logo {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: transparent;
    border-radius: var(--radius-md);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand-logo:hover {
    transform: scale(1.04);
}

.sidebar-brand h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 600;
    display: block;
    letter-spacing: 0.02em;
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.menu-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.08em;
  padding: 1rem 0.85rem 0.35rem;
}

.menu-item {
  position: relative;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--sidebar-radius);
  transition: all 0.2s ease;
}

.menu-item a:hover {
  background-color: var(--sidebar-hover);
  color: #fff;
}

.menu-item.active > a {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.submenu-item.active a {
  color: var(--sidebar-text-active);
  font-weight: 600;
  text-decoration: underline;
}

.menu-item i {
  font-size: 1.05rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--sidebar-chip);
  color: var(--sidebar-text);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Parent category icon only when active */
.menu-item.has-children.active > a > i:first-of-type {
  background: var(--sidebar-active);
  color: #fff;
}

/* Regular menu item icon */
.menu-item:not(.has-children) i {
    background: var(--sidebar-chip);
    color: var(--sidebar-text);
}

.menu-item:not(.has-children).active i {
    background: var(--sidebar-active);
    color: #fff;
}

.menu-item:not(.has-children) a:hover i,
.menu-item.has-children > a:hover i {
  background: rgba(255, 122, 0, 0.18);
  color: #fff;
}

/* Parent menu items - more prominent */
.menu-item.has-children > a {
  font-weight: 600;
  font-size: 0.92rem;
}

.menu-item.has-children > a .chevron {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.menu-item.has-children.active > a .chevron {
  transform: rotate(180deg);
}

.sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  margin: 0.5rem;
  border-radius: var(--sidebar-radius);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(211, 84, 0, 0.4);
}

.user-info-sm {
  flex: 1;
  overflow: hidden;
}

.user-info-sm .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-info-sm .role-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 122, 0, 0.18);
  color: #ffb27a;
  text-transform: capitalize;
  font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Top Header Navbar */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.header-logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    padding: 5px;
    box-shadow: 0 2px 8px rgba(211, 84, 0, 0.3);
    flex-shrink: 0;
}

/* Hide header logo on desktop - sidebar already has logo */
@media (min-width: 993px) {
    .header-logo {
        display: none !important;
    }
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.toggle-sidebar-btn:hover {
  background-color: var(--bg-main);
  color: var(--primary);
}

.page-title-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.digital-clock {
  font-family: 'JetBrains Mono', monospace;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Content Body */
.content-body {
  padding: 1.75rem;
  flex: 1;
  width: 100%;
}

/* Footer Global Styling */
footer, .main-footer {
  width: 100% !important;
  margin-top: auto !important;
  clear: both !important;
  background: var(--bg-card) !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 1.25rem 1.75rem !important;
  color: var(--text-muted) !important;
  font-size: 0.825rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before { background: var(--info); }
.stat-card.stat-accent::before { background: var(--accent); }

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-info .stat-icon { background: #e0f2fe; color: var(--secondary); }
.stat-accent .stat-icon { background: #f3e8ff; color: var(--accent); }

.stat-details h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-details p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(211, 84, 0, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(211, 84, 0, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow: auto;
  max-height: 500px;
  -webkit-overflow-scrolling: touch !important;
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  min-width: 700px; /* Force horizontal scroll on mobile */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table-scroll-wrapper {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-wrapper table {
  min-width: 800px;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f1f5f9;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); }
.badge-info { background: #e0f2fe; color: var(--secondary); }

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--danger);
}

.form-control, .form-select, textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Alerts */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-error, .alert-danger { background: var(--danger-light); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* Sidebar Submenu */
.submenu {
    list-style: none;
    padding-left: 2.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu-item a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem 0.45rem 1rem;
    color: var(--sidebar-text) !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--sidebar-radius);
    transition: all 0.2s ease;
    background: transparent !important;
}

.submenu-item a:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

    .submenu-item.active {
        border-left: none;
    }

    .submenu-item.active a {
        color: var(--sidebar-text-active) !important;
        background: transparent !important;
        font-weight: 600;
        text-decoration: underline;
        text-decoration-color: var(--primary);
        text-decoration-thickness: 2px;
        text-underline-offset: 4px;
        border-radius: var(--sidebar-radius);
        box-shadow: none;
    }

    .submenu-item i {
        font-size: 0.95rem;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: var(--sidebar-chip);
        color: var(--sidebar-text) !important;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .submenu-item.active i {
        background: transparent;
        color: var(--primary) !important;
    }

.submenu-item a:hover i {
    background: rgba(255, 122, 0, 0.18);
    color: #fff;
}

/* Print Styles */
@media print {
  .sidebar, .top-header, .btn, .no-print, .signature-controls {
    display: none !important;
  }
  .main-wrapper {
    margin: 0 !important;
    width: 100% !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 80vw !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5) !important;
    }

    .sidebar.show, .sidebar.active {
        transform: translateX(0) !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    .top-header {
        padding: 0 0.85rem !important;
        height: 60px !important;
    }

    .toggle-sidebar-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: var(--bg-hover) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-md) !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 1.4rem !important;
        color: var(--text-main) !important;
        cursor: pointer !important;
    }
}

@media (max-width: 992px) {
    .grid-sidebar-layout,
    div[style*="grid-template-columns: 1fr 3"],
    div[style*="grid-template-columns: 1fr 2"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        width: 100% !important;
        max-width: 100vw !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
    }

    .app-container {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .main-content, .content-body {
        padding: 0.75rem 0.65rem 4.5rem 0.65rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .top-header {
        padding: 0 0.65rem !important;
        height: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    .header-left {
        display: flex !important;
        align-items: center !important;
        gap: 0.45rem !important;
        min-width: 0 !important;
        flex: 1 !important;
    }

    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        flex-shrink: 0 !important;
    }

    .header-school-badge {
        display: none !important;
    }

    .page-title-header {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 160px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .header-logout-btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    .header-logout-btn .logout-text {
        display: none !important;
    }

    .header-role-badge {
        font-size: 0.72rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    .digital-clock {
        display: none !important;
    }

    .breadcrumb {
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        font-size: 0.8rem !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.85rem !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
    }

    .breadcrumb::-webkit-scrollbar {
        display: none !important;
    }

    .card {
        padding: 1rem 0.75rem !important;
        margin-bottom: 1rem !important;
        border-radius: var(--radius-lg) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .card-header .btn, .card-header .btn-group {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .stat-grid,
    .form-row,
    .form-grid,
    .grid-sidebar-layout,
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .form-control, .form-select {
        font-size: 16px !important;
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
        box-sizing: border-box !important;
    }

    .btn {
        padding: 0.65rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 420px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        display: block !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-md) !important;
        box-sizing: border-box !important;
        margin-bottom: 1rem !important;
        position: relative !important;
    }

    .table-responsive table {
        min-width: 520px !important;
    }

    .legend-guru-list,
    ul[style*="column-count"] {
        column-count: 1 !important;
    }

    .akses-cepat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .table th, .table td {
        padding: 0.55rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .login-card {
        padding: 1.75rem 1.25rem !important;
        margin: auto !important;
        width: 100% !important;
        max-width: 400px !important;
    }

    footer, .main-footer {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.35rem !important;
        padding: 1rem !important;
        font-size: 0.78rem !important;
    }
}

/* Scroll Container - Vertical Auto Scroll */
.scroll-container-y {
  max-height: 420px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  padding-right: 4px;
}

/* Make table headers sticky when scrolling */
.scroll-container-y .table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background-color: #f8fafc !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.scroll-container-y::-webkit-scrollbar {
  width: 6px;
}

.scroll-container-y::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-container-y::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 9999px;
}

.scroll-container-y::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.profile-card {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: #4f46e5;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Legenda Kode Guru Responsive Columns */
.legend-guru-list {
    column-count: 3;
    column-gap: 1.5rem;
    list-style-type: none;
    padding-left: 0;
    font-size: 0.88rem;
    margin-bottom: 0;
}
@media (max-width: 992px) {
    .legend-guru-list {
        column-count: 2 !important;
    }
}
@media (max-width: 768px) {
    .legend-guru-list {
        column-count: 1 !important;
    }
}

/* Akses Cepat Grid System */
.akses-cepat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 992px) {
    .akses-cepat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}
@media (max-width: 480px) {
    .akses-cepat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }
    .akses-cepat-grid .card {
        padding: 1rem 0.5rem !important;
    }
    .akses-cepat-grid .card i {
        font-size: 1.85rem !important;
        margin-bottom: 0.4rem !important;
    }
    .akses-cepat-grid .card strong {
        font-size: 0.82rem !important;
    }
}

/* Global Table Responsive: 2D Full Scrolling (Kiri, Kanan, Atas, Bawah) & Sticky Header */
.table-responsive {
  max-height: 480px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: auto !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  display: block;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.4) rgba(0, 0, 0, 0.05);
}

.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.35);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 119, 6, 0.65);
}

.table-responsive .table {
  margin-bottom: 0;
  width: 100%;
}

.table-responsive .table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background-color: #f8fafc !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06) !important;
  white-space: nowrap;
}

/* Digital Signature Canvas (HP & Mobile Friendly) */
.signature-box {
  background: #ffffff;
  border: 2px dashed var(--border-color, #cbd5e1);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  position: relative;
  touch-action: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  background: #fdfdfd;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.signature-controls {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============================================================
   Form Scroll Wrapper - Form bisa digeser vertikal (mobile)
   Dipakai pada panel form kanan di layout 2-kolom
   ============================================================ */
.form-scroll-wrapper {
  max-height: 80vh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.4) transparent;
}
.form-scroll-wrapper::-webkit-scrollbar { width: 4px; }
.form-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.35);
  border-radius: 4px;
}

/* ============================================================
   Outer Scroll X - Wrapper grid 2-kolom agar bisa digeser
   horizontal di HP (table kiri, form kanan)
   ============================================================ */
.outer-scroll-x {
  width: 100%;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x !important;
  padding-bottom: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.3) transparent;
}
.outer-scroll-x::-webkit-scrollbar { height: 4px; }
.outer-scroll-x::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.35);
  border-radius: 4px;
}

/* Cursor grab hint untuk drag-scroll pada desktop */
.table-responsive,
.scroll-container-y,
.form-scroll-wrapper,
.outer-scroll-x {
  cursor: grab;
}
.table-responsive:active,
.scroll-container-y:active,
.form-scroll-wrapper:active,
.outer-scroll-x:active {
  cursor: grabbing;
}
/* Input/link di dalam scroll wrapper tetap pointer */
.table-responsive a, .table-responsive button,
.form-scroll-wrapper input, .form-scroll-wrapper select,
.form-scroll-wrapper textarea, .form-scroll-wrapper button,
.form-scroll-wrapper a {
  cursor: pointer;
}

