/* ============================================================
   SISFIX - Main Stylesheet
   Modern Web Application with Green Color Scheme
   ============================================================ */

/* ------------------------------------------------------------
   CSS Reset & Variables
   ------------------------------------------------------------ */

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

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* --- Light Theme (Default) --- */

:root {
    /* Primary brand colors */
    --color-primary: #10B981;
    --color-secondary: #059669;
    --color-accent: #34D399;
    --color-primary-rgb: 16, 185, 129;

    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;

    /* Borders */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Semantic colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
    --mobile-nav-height: 60px;

    /* Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* --- Dark Theme --- */

[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --border-color: #475569;
    --border-light: #334155;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}


/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.25rem;
    letter-spacing: -0.015em;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

.text-small {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--color-primary);
}

.text-danger {
    color: var(--color-danger);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

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

.text-right {
    text-align: right;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}


/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height);
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.app-wrapper.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    margin-bottom: 0;
}

.page-header p {
    margin-bottom: 0;
    color: var(--text-muted);
}


/* ------------------------------------------------------------
   Navbar (.navbar)
   ------------------------------------------------------------ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    transition: background-color var(--transition);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.navbar-brand img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

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

/* Navbar Search */

.navbar-search {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.navbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.navbar-search input {
    width: 100%;
    padding: 8px 14px 8px 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-search input::placeholder {
    color: var(--text-muted);
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
    background-color: var(--bg-primary);
}

/* Button Icon */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon i {
    width: 20px;
    height: 20px;
}

/* Theme Toggle */

.theme-toggle .icon-light {
    display: inline-flex;
}

.theme-toggle .icon-dark {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-light {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-dark {
    display: inline-flex;
}

/* Notification Badge */

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background-color: var(--color-danger);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--bg-primary);
}

/* Navbar Dropdown */

.navbar-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
    z-index: 1050;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-user-info {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-user-info .user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-user-info .user-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dropdown-user-info .badge {
    font-size: 10px;
    padding: 2px 8px;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-item.text-danger {
    color: var(--color-danger);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
}

/* Avatar Button */

.btn-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-fast);
    flex-shrink: 0;
}

.btn-avatar:hover {
    border-color: var(--color-primary);
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: #FFFFFF;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}


/* ------------------------------------------------------------
   Sidebar (.sidebar)
   ------------------------------------------------------------ */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    z-index: 998;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-list {
    list-style: none;
    padding: 8px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    gap: 12px;
    font-size: 0.9375rem;
    font-weight: 400;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

.nav-link i,
.nav-link [data-lucide] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--transition), width var(--transition);
}

.sidebar-collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.nav-separator {
    border-top: 1px solid var(--border-color);
    margin: 12px 16px;
}

.nav-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}


/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast), box-shadow var(--transition-fast),
                transform var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.3);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: #FFFFFF;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #FFFFFF;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background-color: #DC2626;
    border-color: #DC2626;
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-block {
    width: 100%;
}

/* Btn icon is also defined above for navbar; this extends for general use */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}


/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-label .required {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-control:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-error {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--color-danger);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .input-group-append {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.input-group .input-group-prepend {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input-group .input-group-prepend + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

/* Checkbox & Radio */

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Toggle Switch */

.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch .switch-slider {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-full);
    background-color: var(--border-color);
    position: relative;
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
}

.form-switch .switch-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: #FFFFFF;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-switch input:checked + .switch-slider {
    background-color: var(--color-primary);
}

.form-switch input:checked + .switch-slider::after {
    transform: translateX(20px);
}


/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */

.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

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

.card-header h3,
.card-header h4 {
    margin-bottom: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

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


/* ------------------------------------------------------------
   Badges
   ------------------------------------------------------------ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-2xl);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    gap: 4px;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 11px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

[data-theme="dark"] .badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #D97706;
}

[data-theme="dark"] .badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

[data-theme="dark"] .badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}

[data-theme="dark"] .badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.badge-primary {
    background-color: var(--color-primary);
    color: #FFFFFF;
}

.badge-neutral {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}


/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr {
    transition: background-color var(--transition-fast);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.table-striped tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}


/* ------------------------------------------------------------
   Alerts / Flash Messages
   ------------------------------------------------------------ */

.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 0;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.35s ease-out;
    pointer-events: all;
    border-left: 4px solid transparent;
    font-size: 0.9375rem;
}

.flash-message i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.flash-message .flash-text {
    flex: 1;
}

.flash-success {
    background-color: rgba(16, 185, 129, 0.08);
    border-left-color: var(--color-success);
    color: #065F46;
}

[data-theme="dark"] .flash-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #A7F3D0;
}

.flash-error {
    background-color: rgba(239, 68, 68, 0.08);
    border-left-color: var(--color-danger);
    color: #991B1B;
}

[data-theme="dark"] .flash-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

.flash-warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-left-color: var(--color-warning);
    color: #92400E;
}

[data-theme="dark"] .flash-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #FDE68A;
}

.flash-info {
    background-color: rgba(59, 130, 246, 0.08);
    border-left-color: var(--color-info);
    color: #1E40AF;
}

[data-theme="dark"] .flash-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #BFDBFE;
}

.flash-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity var(--transition-fast), background-color var(--transition-fast);
    flex-shrink: 0;
}

.flash-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.08);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ------------------------------------------------------------
   Dashboard Widgets
   ------------------------------------------------------------ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background-color: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-card .stat-info {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 6px;
}

.stat-card .stat-trend.up {
    color: var(--color-success);
}

.stat-card .stat-trend.down {
    color: var(--color-danger);
}

.stat-card .stat-trend i {
    width: 14px;
    height: 14px;
}

/* Stat card icon color variants */

.stat-icon.stat-icon-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.stat-icon.stat-icon-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.stat-icon.stat-icon-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}


/* ------------------------------------------------------------
   Mobile Bottom Navigation (.mobile-bottom-nav)
   ------------------------------------------------------------ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-nav-height);
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    align-items: stretch;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 8px;
    padding-bottom: 4px;
    gap: 2px;
    flex: 1;
    text-align: center;
    transition: color var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.mobile-nav-item i {
    width: 22px;
    height: 22px;
}

.mobile-nav-item.active {
    color: var(--color-primary);
}

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background-color: var(--color-primary);
}

.mobile-nav-center {
    position: relative;
}

.mobile-nav-center .mobile-nav-plus {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
    border: 3px solid var(--bg-primary);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.mobile-nav-center .mobile-nav-plus:hover {
    background-color: var(--color-secondary);
}

.mobile-nav-center .mobile-nav-plus:active {
    transform: translateX(-50%) scale(0.95);
}

.mobile-nav-center .mobile-nav-plus i {
    width: 24px;
    height: 24px;
}


/* ------------------------------------------------------------
   Auth Pages (Login, Register)
   ------------------------------------------------------------ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    padding: 20px;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    max-width: 180px;
    margin: 0 auto 16px auto;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--color-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-social {
    display: flex;
    gap: 12px;
}

.auth-social .btn {
    flex: 1;
}


/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */

.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast);
}

.page-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.page-link.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #FFFFFF;
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-link i {
    width: 16px;
    height: 16px;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}


/* ------------------------------------------------------------
   Modals
   ------------------------------------------------------------ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-fast);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    margin-bottom: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}


/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */

/* Display */
.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-grid { display: grid; }
.d-inline-flex { display: inline-flex; }
.d-inline-block { display: inline-block; }

/* Flexbox */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.gap-5 { gap: 32px; }

/* Margin */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.px-4 { padding-left: 24px; padding-right: 24px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* Width */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Border Radius */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Text Truncation */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Borders */
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-none { border: none; }

/* Position */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Cursor */
.cursor-pointer { cursor: pointer; }


/* ------------------------------------------------------------
   Custom Scrollbar
   ------------------------------------------------------------ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}


/* ------------------------------------------------------------
   Transitions & Animations
   ------------------------------------------------------------ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.3s ease-out; }
.animate-slide-right { animation: slideInRight 0.3s ease-out; }
.animate-scale-in { animation: scaleIn 0.2s ease-out; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
}


/* ------------------------------------------------------------
   Empty States
   ------------------------------------------------------------ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-icon i {
    width: 28px;
    height: 28px;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 360px;
    margin-bottom: 20px;
}


/* ------------------------------------------------------------
   Responsive: Tablet (max-width: 1024px)
   ------------------------------------------------------------ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-center {
        display: none;
    }

    .content-wrapper {
        padding: 20px 16px;
    }
}


/* ------------------------------------------------------------
   Responsive: Mobile (max-width: 768px)
   ------------------------------------------------------------ */

@media (max-width: 768px) {
    /* Sidebar becomes overlay on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
        width: var(--sidebar-width);
        top: 0;
        height: 100vh;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar-collapsed .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: var(--mobile-nav-height);
    }

    .app-wrapper.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Stats grid single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Auth page adjustments */
    .auth-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .auth-title {
        font-size: 20px;
    }

    /* Navbar adjustments */
    .navbar {
        padding: 0 12px;
    }

    .navbar-brand span {
        display: none;
    }

    /* Table responsive */
    .table-wrapper {
        border-radius: var(--radius);
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }

    /* Flash messages */
    .flash-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Stat card */
    .stat-card .stat-value {
        font-size: 24px;
    }

    /* Card */
    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .card-footer {
        padding: 12px 16px;
    }

    /* Modal */
    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header,
    .modal-footer {
        padding: 16px;
    }

    /* Dropdown */
    .dropdown-menu {
        min-width: 240px;
    }
}


/* ------------------------------------------------------------
   Responsive: Small Mobile (max-width: 480px)
   ------------------------------------------------------------ */

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .content-wrapper {
        padding: 16px 12px;
    }

    .btn {
        padding: 8px 16px;
    }

    .btn-lg {
        padding: 12px 20px;
    }

    .pagination {
        gap: 2px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }
}


/* ------------------------------------------------------------
   Print Styles
   ------------------------------------------------------------ */

@media print {
    .navbar,
    .sidebar,
    .mobile-bottom-nav,
    .flash-container,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background: #FFFFFF;
        color: #000000;
    }

    .card {
        box-shadow: none;
        border: 1px solid #DDD;
    }
}
