/* =====================================
   ROOT VARIABLES & GLOBAL RESET
===================================== */
:root {
    --primary: #003366;
    --primary-800: #002a4a;
    --secondary: #FF6600;
    --bg: #F4F4F4;
    --text: #1A1A1A;
    --white: #FFF;
    --sidebar-width: 260px;
    --trans: 250ms ease;
    --radius: 12px;
}
/* General & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #F4F4F4;
    display: flex;
}

/* =====================================
   TOPBAR
===================================== */
.topbar {
    background: #FFF;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8e9;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topbar .left { display: flex; align-items: center; gap: 1rem; }
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; }

.btn-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
}

/* =========================
   MOBILE FIXES
========================= */
@media (max-width: 768px) {
    /* Remove fixed sidebar spacing */
    .main {
        margin-left: 0 !important;
        width: 100%;
        padding: 1rem;
    }

    /* Make topbar elements wrap if needed */
    .topbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* =========================
   PAGE CONTENT
========================= */
.content {
  padding: 1.5rem 1.5rem 2.5rem;
}

@media (min-width: 768px) { /* adjust breakpoint as needed */
  .content {
    padding: 1rem 1.5rem 2.5rem;
  }
}

/* =====================================
    SIDEBAR
===================================== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px; /* Adjust as needed */
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--primary), var(--primary-800));
    color: var(--white);
    box-shadow: 2px 10px 30px rgba(0,0,0,0.08);
    transition: transform var(--trans);
    z-index: 200;
}

.sidebar-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.5rem;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed ~ .main {
    margin-left: 0;
    width: 100%;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar.collapsed + .main {
  margin-left: 80px;
}

.main {
  transition: margin-left 0.3s ease;
}

.logo-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
}
.logo-left i { font-size: 1.8rem; color: var(--secondary); }
.logo-left h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0.5rem;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 15px;
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: background var(--trans), transform var(--trans);
}
.nav-link:hover { background: rgba(255,255,255,0.08); transform: translateX(4px); }
.nav-link.active { background: rgba(255,255,255,0.12); position: relative; }
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -6px; top: 8px; bottom: 8px;
    width: 6px;
    background: var(--secondary);
    border-radius: 4px;
}

.footer-btn {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* ------------------ Media Queries ------------------ */
@media (max-width: 992px) {

    .sidebar {
        transform: translateX(-100%);
    }

    .main {
        margin-left: 0;
    }
}

/* =====================================
   MODAL (ADD/EDIT/LOGOUT)
===================================== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-align: left;
  max-width: 350px;
  width: 100%;
  animation: fadeIn 0.25s ease;
}
.modal-content h2 {
  margin: 0 0 10px;
  color: var(--primary);
  text-align: center;
}
.modal-content p {
  margin-bottom: 20px;
  color: var(--text);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-secondary {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg);
  cursor: pointer;
}
.btn-secondary:hover { background: #ddd; }
.btn-danger {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  background: #e53935;
  color: white;
  cursor: pointer;
}
.btn-danger:hover { background: #c62828; }

/* Modal Form Inputs */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.checkbox-group { display: flex; align-items: center; }
.checkbox-group label { margin-left: 8px; }

/* =====================================
   ANIMATIONS
===================================== */
@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =====================================
   TABLES
===================================== */
th.sortable {
  cursor: pointer;
}
