:root {
  --primary-color: #059669;
  --primary-hover: #047857;
  --secondary-color: #64748b;
  --bg-color: #f8fafc;
  --sidebar-bg: #f1f5f9;
  --sidebar-hover: #e2e8f0;
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.04), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --card-hover-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(226, 232, 240, 0.8);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: #1e293b;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 0.875rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background-color: var(--sidebar-bg);
  color: #334155;
  z-index: 1050;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid #e2e8f0;
  display: flex !important;
  flex-direction: column !important;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-footer {
  padding: 0.5rem 0;
  border-top: 1px solid #e2e8f0;
  background: var(--sidebar-bg);
}

#sidebar.collapsed {
  width: 85px;
}

#sidebar.collapsed .sidebar-header h5 span,
#sidebar.collapsed .sidebar-item span,
#sidebar.collapsed .category-header span {
  display: none;
}

#sidebar.collapsed .sidebar-header h5 {
  padding: 0;
}

#sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.875rem 0;
  margin: 0.25rem 0.5rem;
}

#sidebar.collapsed .sidebar-item i {
  margin: 0;
  font-size: 1.25rem;
  width: 100%;
  text-align: center;
}

.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }
.x-small { font-size: 0.7rem; }

.sidebar-header {
  padding: 1rem 1.25rem;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h5 {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  margin: 0;
  color: var(--primary-color);
  font-size: 1rem;
}

.category-header {
  padding: 0.65rem 1rem 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-item {
  padding: 0.4rem 0.825rem;
  margin: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  color: #64748b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.sidebar-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  color: #94a3b8;
}

/* Upload Area Styles */
.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: #f8fafc;
    text-align: center;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-item {
    transition: all 0.2s;
    border: 1px solid #edf2f7;
}

.file-item:hover {
    background: #fff !important;
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.sidebar-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar-item:hover i {
  color: var(--primary-color);
}

.sidebar-item.active {
  background: rgba(5, 150, 105, 0.08);
  color: var(--primary-color);
  box-shadow: none;
}

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

.main-content {
  margin-left: 280px;
  min-height: 100vh;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
  margin-left: 85px;
}

.top-navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.top-navbar h5 {
    font-size: 1.1rem;
}

.top-navbar .dropdown-menu {
  z-index: 2000;
}

.content-body {
  padding: 1rem 1.5rem;
}

.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
}

.card-header {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.card-body {
    padding: 1rem;
}

.card-stat {
  border-radius: 0.5rem;
}

.table {
    font-size: 0.825rem;
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    color: #64748b;
    background-color: #f8fafc;
    border-top: none;
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.btn {
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.form-control, .form-select {
    font-size: 0.825rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    border-color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.modal-header {
    padding: 0.75rem 1.25rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
}

.modal-footer {
    padding: 0.5rem 1.25rem;
}

.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    font-size: 0.7rem;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.25);
}

/* Animations Helper */
.fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glassmorphism for Login */
.login-page {
  background: #f1f5f9 url('../../uploads/login/login.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, rgba(241, 245, 249, 0.8) 100%);
  backdrop-filter: blur(4px);
}

.login-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid #ffffff;
  border-radius: 2rem;
  width: 100%;
  max-width: 450px;
  padding: 3rem;
  z-index: 2;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

.login-card h2 {
    color: var(--primary-color);
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: #64748b;
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .form-control {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
}

.login-card .form-control:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.login-card .btn-primary {
  background: var(--primary-color);
  border: none;
  padding: 0.8rem;
  border-radius: 1rem;
  font-weight: 700;
  margin-top: 1rem;
}

/* Inline auth panel switch (login/register) - robust, no overflow issues */
/* Notification Styles */
.notif-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: none !important;
    margin-bottom: 2px;
    display: block;
    text-decoration: none;
    background: transparent;
}

.notif-item:hover {
    background-color: #f8fafc;
    transform: translateX(3px);
}

.notif-item.unread {
    background-color: rgba(5, 150, 105, 0.05);
}

.notif-item.unread:hover {
    background-color: rgba(5, 150, 105, 0.08);
}

.notif-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.notif-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
}

.notif-msg {
    color: #334155;
    font-size: 0.825rem;
    line-height: 1.4;
}

.notif-unread-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
}

.notif-dropdown-header {
    background: #fff;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.notif-dropdown-footer {
    background: #f8fafc;
    padding: 0.6rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}
.auth-panel.auth-login { display: block; }
.auth-panels.show-register .auth-login { display: none; }
.auth-panels.show-register .auth-register { display: block; }
.auth-panel [type="button"].btn-link { color: inherit; }

/* In register mode, hide the login header and tighten top spacing */
.login-card.auth-register-mode .auth-global-header { display: none !important; }
.login-card.auth-register-mode { padding-top: 1rem; }
.auth-panel.auth-register .register-header { margin-bottom: 0.75rem; }

.content-body, .content-wrapper {
  padding: 1rem;
}

.main-header {
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(5, 150, 105, 0.04);
}

.table thead th {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.table td {
    font-size: 0.825rem;
    padding: 0.5rem 0.75rem;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  padding: 0.45rem 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  font-size: 0.825rem;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.825rem;
}

.badge {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Responsive Table Fix */
.table-responsive {
  margin-bottom: 2rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}
.transition-hover {
  transition: all 0.2s ease-in-out;
}

.transition-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* ========== Split-screen Login Layout Scaling (for current index.php) ========== */
.login-wrapper { display: flex; height: 100dvh; overflow: hidden; }
.login-banner {
  flex: 1.5;
  position: relative;
  background: url('../../uploads/login/login.jpg') center/cover no-repeat;
}
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(241,245,249,0.9)); }
.banner-content { position: relative; z-index: 1; margin-top: auto; padding: clamp(16px, 6vh, 48px); color: #1e293b; }
.banner-features, .banner-footer { opacity: 0.85; }

.login-form-container { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(12px, 4vh, 32px); }
.login-box { width: 100%; max-width: 420px; }
.login-header h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

@media (max-width: 992px) {
  .login-wrapper { flex-direction: column; }
  .login-banner { flex: none; height: 40vh; }
  .login-form-container { flex: 1; }
}

@media (max-height: 720px) {
  .banner-features, .banner-footer { display: none; }
  .login-header .logo-box { transform: scale(0.9); }
}

@media (max-height: 640px) {
  .login-banner { height: 35vh; }
}

/* ==================== Dashboard Fit ==================== */
body.dashboard-fit .main-content {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevent page scroll; inner content scrolls if needed */
}
body.dashboard-fit .top-navbar { padding: 0.75rem 1.25rem; }
body.dashboard-fit .content-body {
  flex: 1 1 auto;
  padding: 1rem; /* was 2rem globally */
  overflow: auto;
}
body.dashboard-fit .content-body > .container-fluid { padding-top: 1rem !important; }
body.dashboard-fit .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
body.dashboard-fit .mb-5 { margin-bottom: 1.25rem !important; }
body.dashboard-fit .card-header { padding: 0.5rem 0.75rem; }
body.dashboard-fit .card .card-body { padding: 0.85rem 1rem; }
body.dashboard-fit h2, body.dashboard-fit h3, body.dashboard-fit h6 { margin-bottom: 0.5rem; }

/* Sidebar & Mobile Fixes */
@media (max-width: 991.98px) {
    #sidebar {
        left: -280px;
    }
    #sidebar.mobile-show {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1045;
        display: none;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

.sidebar-item {
    cursor: pointer;
    user-select: none;
}

#sidebar {
    z-index: 1060;
}
