/* ==========================================================================
   TOLIOUS STYLE DESIGN SYSTEM (MODERN BLUE THEME)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');


:root {
    /* Brand Colors (Vibrant Blue) */
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-primary-light: #eff6ff;
    
    /* Backgrounds */
    --bg-app: #f4f6f9; /* Tolious neutral SaaS off-white (less blue) */
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;
    
    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    /* Borders & Dividers */
    --border-light: #f1f5f9;
    --border-hover: #e2e8f0;
    
    /* State Colors */
    --state-success: #22c55e;
    --state-success-bg: #f0fdf4;
    --state-warning: #f59e0b;
    --state-warning-bg: #fffbeb;
    --state-danger: #ef4444;
    --state-danger-bg: #fef2f2;
    --state-info: #3b82f6;
    --state-info-bg: #eff6ff;
    
    /* Shadows - Tolious Airy */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 40px -10px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 50px -12px rgba(0,0,0,0.08);
    --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.1);
    
    /* Border Radii - TOLIOUS STYLE */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-pill: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-app) !important;
    color: var(--text-secondary) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 0.925rem !important;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-left: 260px;
    transition: padding-left var(--transition-smooth);
    overflow-x: hidden;
}

body.sidebar-collapsed {
    padding-left: 80px;
}

.container {
    max-width: 100% !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}

@media (max-width: 768px) {
    body {
        padding-left: 0 !important;
    }
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Top Header
   ========================================================================== */
.top-header {
    height: 72px;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    padding: 0 40px;
    z-index: 1030;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.toggle-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.toggle-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */
#mainAdminSidebar.navbar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    z-index: 1040;
    background: var(--bg-surface) !important; 
    border-right: 1px solid var(--border-hover) !important;
    box-shadow: none !important;
    transition: width var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
}
body.sidebar-collapsed #mainAdminSidebar.navbar {
    width: 80px;
}

#mainAdminSidebar .navbar-toggler { display: none !important; }

#mainAdminSidebar .navbar-brand {
    width: 100%;
    padding: 24px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border-hover);
    margin: 0 !important;
    text-align: center;
}
#mainAdminSidebar .navbar-brand img {
    max-width: 100%;
    max-height: 40px;
    object-fit: contain;
    transition: all var(--transition-smooth);
}
body.sidebar-collapsed #mainAdminSidebar .navbar-brand img {
    opacity: 0;
    transform: scale(0.8);
    display: none;
}

#mainAdminSidebar .navbar-collapse {
    width: 100%;
    flex-direction: column;
    align-items: flex-start !important;
    padding: 12px;
    display: flex !important;
}
#mainAdminSidebar .navbar-nav {
    flex-direction: column !important;
    width: 100%;
    gap: 4px;
}
#mainAdminSidebar .nav-item {
    width: 100%;
}
#mainAdminSidebar .nav-link {
    color: var(--text-secondary) !important;
    padding: 10px 16px !important;
    white-space: nowrap;
    border-radius: 8px !important; /* Perfect pill logic */
    margin: 4px 12px !important;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 500;
}
body.sidebar-collapsed #mainAdminSidebar .nav-link {
    font-size: 0;
    padding: 16px 0 !important;
    margin: 4px 12px !important;
    justify-content: center;
}
#mainAdminSidebar .nav-item.active > .nav-link, 
#mainAdminSidebar .nav-link:hover {
    color: var(--brand-primary) !important;
    background-color: var(--brand-primary-light) !important;
    font-weight: 700;
}

#mainAdminSidebar .fa-icon, #mainAdminSidebar .fas {
    width: 24px;
    text-align: center;
    font-size: 1.1rem !important;
    margin-right: 12px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}
#mainAdminSidebar .nav-item.active > .nav-link .fa-icon,
#mainAdminSidebar .nav-item.active > .nav-link .fas {
    color: var(--brand-primary) !important;
}
#mainAdminSidebar .nav-link:hover .fa-icon,
#mainAdminSidebar .nav-link:hover .fas {
    color: var(--brand-primary) !important;
}

body.sidebar-collapsed #mainAdminSidebar .fa-icon, 
body.sidebar-collapsed #mainAdminSidebar .fas {
    margin-right: 0 !important;
    width: 100%;
    font-size: 1.25rem !important;
}

@media (max-width: 768px) {
    #mainAdminSidebar.navbar {
        transform: translateX(-260px);
    }
    body.sidebar-mobile-active #mainAdminSidebar.navbar {
        transform: translateX(0);
        border-right: 1px solid var(--border-light);
    }
}


/* ==========================================================================
   Cards & Sections
   ========================================================================== */
.card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-hover) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
    margin-bottom: 30px;
    transition: all var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

/* Glass Card - Transparent Wrapper for floating layouts */
.glass-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.glass-card > .card-header {
  background: #fff !important;
  border-bottom: none !important;
  padding: 24px 12px 28px 13px !important;
}
.glass-card > .card-body {
  padding: 0 !important;
  background: #fff !important;
}

/* Section Card - Nested Pristine Modules */
.section-card {
  background: #ffffff;
  border-radius: var(--radius-md, 16px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
  border: 1px solid var(--border-hover, #e2e8f0);
  margin-bottom: 28px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.section-card .section-card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  color: var(--text-primary, #0f172a);
  padding: 24px 32px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-card .section-card-header i {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-primary-light, #eff6ff);
  color: var(--brand-primary, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.section-card .section-card-body {
  padding: 24px 32px;
}

.section-header-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
}

.section-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--brand-primary);
    font-size: 1.2rem;
}

.section-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ==========================================================================
   Input Labels (Tolious Exact Style)
   ========================================================================== */
.form-group > label, 
.section-card .form-label,
.section-card .form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: block;
}


/* ==========================================================================
   Buttons (Tolious Style)
   ========================================================================== */
.btn {
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary, .btn-premium {
    background: var(--brand-primary) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.2) !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.3) !important;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-control, .form-select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-hover) !important;
    padding: 4px 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
}

.form-control:focus {
    border-color: var(--brand-primary) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px var(--brand-primary-light) !important;
    outline: none !important;
}

/* Select2 Customization to match reference */
.select2-container--default .select2-selection--single {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-light) !important;
    height: 50px !important;
    padding: 10px !important;
}

/* ==========================================================================
   DataTables Premium Styling
   ========================================================================== */
.dataTables_wrapper label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    color: var(--text-secondary) !important;
    letter-spacing: normal !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-hover) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px var(--brand-primary-light) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--brand-primary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(37,99,235,0.2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    background: var(--bg-surface-hover) !important;
    border-color: var(--border-hover) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   Universal Component Standard
   ========================================================================== */
.table-premium {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 12px !important; /* Defined vertical gap between rows */
    margin-top: -12px !important; /* Offset first row gap */
}

.table-premium thead th {
    background: transparent !important;
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    padding: 12px 24px !important;
    border-bottom: 2px solid var(--border-light) !important;
    vertical-align: middle !important;
}

.table-premium tbody tr {
    transition: all var(--transition-smooth);
}

.table-premium tbody tr:hover {
    transform: translateY(-2px);
}

.table-premium tbody td {
    background: #ffffff !important;
    border-top: 1px solid var(--border-light) !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 18px 24px !important;
    vertical-align: middle !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
}

.table-premium tr td:first-child {
    border-left: 1px solid var(--border-light) !important;
    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
}

.table-premium tr td:last-child {
    border-right: 1px solid var(--border-light) !important;
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.table-premium tr td:first-child {
    border-left: 1px solid var(--border-light) !important;
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.table-premium tr td:last-child {
    border-right: 1px solid var(--border-light) !important;
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* Badges */
.badge {
    padding: 6px 14px !important;
    border-radius: var(--radius-pill) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
}

.badge-success { background: var(--state-success-bg) !important; color: var(--state-success) !important; }
.badge-danger { background: var(--state-danger-bg) !important; color: var(--state-danger) !important; }
.badge-warning { background: var(--state-warning-bg) !important; color: var(--state-warning) !important; }
.badge-info { background: var(--state-info-bg) !important; color: var(--state-info) !important; }

/* ==========================================================================
   Action Buttons (Minimalist Icons)
   ========================================================================== */
.action-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.btn-action:hover {
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
}

.btn-action.edit:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-action.view:hover { background: #10b981; border-color: #10b981; }
.btn-action.delete:hover { background: #ef4444; border-color: #ef4444; }
.btn-action.download:hover { background: #6366f1; border-color: #6366f1; }