/* ===================================================
   SaaS Starter Kit - Main Stylesheet
   Professional Theme System with CSS Variables
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ===================================================
   CSS Variables — Injected from DB via PHP
   =================================================== */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --text-color: #1e293b;
    --muted-text-color: #94a3b8;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --sidebar-color: #ffffff;
    --navbar-color: #ffffff;
    --border-color: #e2e8f0;
    --hover-color: #f8fafc;
    --font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-size-base: 0.9375rem;
    --heading-font-weight: 600;
    --border-radius: 10px;
    --card-radius: 12px;
    --button-radius: 8px;
    --input-radius: 8px;
    --shadow-style: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    --transition-speed: 0.2s;

    /* Sidebar dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --navbar-height: 64px;

    /* ── Shorthand aliases (used by settings CSS) ── */
    --primary:    var(--primary-color);
    --card-bg:    var(--card-background);
    --border:     var(--border-color);
    --text:       var(--text-color);
    --text-muted: var(--muted-text-color);
    --hover:      var(--hover-color);
    --transition: var(--transition-speed);
    --btn-radius: var(--button-radius);
    --danger:     var(--danger-color);
    --success:    var(--success-color);
    --warning:    var(--warning-color);
    --info:       var(--info-color);
}

/* ===================================================
   Dark Mode Overrides
   =================================================== */
[data-theme="dark"] {
    --text-color: #e2e8f0;
    --muted-text-color: #64748b;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --sidebar-color: #1e293b;
    --navbar-color: #1e293b;
    --border-color: #334155;
    --hover-color: #334155;
    --light-color: #1e293b;
    --dark-color: #f1f5f9;
    --shadow-style: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);

    /* Shorthand aliases — must be re-declared in dark mode too */
    --card-bg:    var(--card-background);
    --border:     var(--border-color);
    --text:       var(--text-color);
    --text-muted: var(--muted-text-color);
    --hover:      var(--hover-color);
}

/* ===================================================
   Reset & Base
   =================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: color-mix(in srgb, var(--primary-color) 80%, black);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===================================================
   Layout: App Shell
   =================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-color);
    border-right: 1px solid var(--border-color);
    transition: width var(--transition-speed) ease, background-color var(--transition-speed) ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: visible; /* sidebar-nav handles its own scroll */
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    overflow: auto; /* clip text/icons during collapse animation */
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.app-navbar {
    height: var(--navbar-height);
    background-color: var(--navbar-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    transition: background-color var(--transition-speed) ease;
    box-shadow: var(--shadow-style);
}

.app-content {
    flex: 1;
    padding: 1.75rem;
}

/* ===================================================
   Sidebar Components
   =================================================== */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--navbar-height);
    overflow: auto;
    white-space: nowrap;
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-img {
    height: 36px;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.sidebar-brand-logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: auto;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar-group {
    padding: 0.25rem 0;
}

.sidebar-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-text-color);
    padding: 0.5rem 1rem 0.25rem;
    white-space: nowrap;
    overflow: auto;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--muted-text-color);
    border-radius: var(--border-radius);
    margin: 0.125rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    overflow: auto;
    position: relative;
}

.sidebar-link:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.sidebar-link.active {
    background-color: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-link-text {
    flex: 1;
    overflow: auto;
    text-overflow: ellipsis;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-link-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Collapsed sidebar states */
.app-sidebar.collapsed .sidebar-brand-name,
.app-sidebar.collapsed .sidebar-group-label,
.app-sidebar.collapsed .sidebar-link-text,
.app-sidebar.collapsed .sidebar-link-badge {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.app-sidebar.collapsed .sidebar-link {
    padding: 0.625rem;
    margin: 0.125rem auto;
    width: calc(var(--sidebar-collapsed-width) - 1.25rem);
    justify-content: center;
}

.app-sidebar.collapsed .sidebar-link.active::before {
    display: none;
}

/* ===================================================
   Navbar Components
   =================================================== */
.navbar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    color: var(--muted-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.navbar-toggle:hover {
    background-color: var(--hover-color);
    color: var(--text-color);
}

.navbar-spacer {
    flex: 1;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    color: var(--muted-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.navbar-action-btn:hover {
    background-color: var(--hover-color);
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    color: var(--muted-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.theme-toggle-btn:hover {
    background-color: var(--hover-color);
    color: var(--text-color);
}

.navbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: border-color var(--transition-speed) ease;
}

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

.navbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    padding: 0.375rem 0.75rem;
    max-width: 240px;
    transition: all var(--transition-speed) ease;
}

.navbar-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
}

.navbar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.875rem;
    width: 160px;
    font-family: var(--font-family);
}

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

/* ===================================================
   Cards
   =================================================== */
.card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-style);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
    overflow: hidden;
    padding: 25px;

}

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

.card-title {
    font-size: 0.9375rem;
    font-weight: var(--heading-font-weight);
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: color-mix(in srgb, var(--card-background) 50%, var(--background-color));
}

/* Stats Cards */
.stat-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-style);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.stat-card-info {
    flex: 1;
}

.stat-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-text-color);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.stat-card-change {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

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

/* ===================================================
   Buttons
   =================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--button-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    line-height: 1.5;
    font-family: var(--font-family);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    outline-offset: 2px;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

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

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 85%, black);
    border-color: color-mix(in srgb, var(--primary-color) 85%, black);
    color: white;
}

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

.btn-secondary:hover {
    background-color: var(--hover-color);
    border-color: color-mix(in srgb, var(--border-color) 70%, black);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: color-mix(in srgb, var(--success-color) 85%, black);
}

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

.btn-danger:hover {
    background-color: color-mix(in srgb, var(--danger-color) 85%, black);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

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

.btn-outline-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.btn-ghost {
    background: none;
    border-color: transparent;
    color: var(--muted-text-color);
}

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

/* ===================================================
   Forms
   =================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--text-color);
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    transition: all var(--transition-speed) ease;
    outline: none;
    font-family: var(--font-family);
}

.form-control::placeholder {
    color: var(--muted-text-color);
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--hover-color);
    opacity: 0.8;
    cursor: not-allowed;
}

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

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-color) 15%, transparent);
}

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

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
}

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

.form-error {
    font-size: 0.8125rem;
    color: var(--danger-color);
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.input-group .form-control {
    flex: 1;
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-radius: var(--input-radius) 0 0 var(--input-radius);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5625rem 0.875rem;
    background-color: var(--hover-color);
    border: 1px solid var(--border-color);
    color: var(--muted-text-color);
    font-size: 0.875rem;
}

.input-group-text:first-child {
    border-right: none;
    border-radius: var(--input-radius) 0 0 var(--input-radius);
}

.input-group-text:last-child {
    border-left: none;
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Color input */
input[type="color"].form-control {
    padding: 0.25rem 0.375rem;
    height: 42px;
    cursor: pointer;
}

/* ===================================================
   Alerts & Toasts
   =================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
    color: inherit;
    opacity: 0.7;
    line-height: 1;
    flex-shrink: 0;
}

.alert-dismiss:hover {
    opacity: 1;
}

.alert-success {
    background-color: color-mix(in srgb, var(--success-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--success-color) 30%, transparent);
    color: color-mix(in srgb, var(--success-color) 80%, black);
}

.alert-danger,
.alert-error {
    background-color: color-mix(in srgb, var(--danger-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--danger-color) 30%, transparent);
    color: color-mix(in srgb, var(--danger-color) 80%, black);
}

.alert-warning {
    background-color: color-mix(in srgb, var(--warning-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--warning-color) 30%, transparent);
    color: color-mix(in srgb, var(--warning-color) 80%, black);
}

.alert-info {
    background-color: color-mix(in srgb, var(--info-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--info-color) 30%, transparent);
    color: color-mix(in srgb, var(--info-color) 80%, black);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}

.toast {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    pointer-events: all;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid var(--border-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--muted-text-color);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-text-color);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color var(--transition-speed) ease;
}

.toast-close:hover {
    color: var(--text-color);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.removing {
    animation: toastSlideOut 0.25s ease forwards;
}

/* ===================================================
   Tables
   =================================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--card-radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead tr {
    background-color: color-mix(in srgb, var(--background-color) 60%, var(--card-background));
    border-bottom: 2px solid var(--border-color);
}

thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) ease;
}

tbody tr:hover {
    background-color: var(--hover-color);
}

tbody td {
    padding: 0.875rem 1rem;
    color: var(--text-color);
    vertical-align: middle;
}

tbody tr:last-child {
    border-bottom: none;
}

/* ===================================================
   Badges
   =================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-primary {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
}

.badge-success {
    background: color-mix(in srgb, var(--success-color) 15%, transparent);
    color: var(--success-color);
}

.badge-danger {
    background: color-mix(in srgb, var(--danger-color) 15%, transparent);
    color: var(--danger-color);
}

.badge-warning {
    background: color-mix(in srgb, var(--warning-color) 15%, transparent);
    color: var(--warning-color);
}

.badge-info {
    background: color-mix(in srgb, var(--info-color) 15%, transparent);
    color: var(--info-color);
}

.badge-secondary {
    background: color-mix(in srgb, var(--secondary-color) 15%, transparent);
    color: var(--secondary-color);
}

/* ===================================================
   Avatars
   =================================================== */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
}

.avatar-md {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-xl {
    width: 80px;
    height: 80px;
}

.avatar-2xl {
    width: 120px;
    height: 120px;
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    border: 2px solid var(--card-background);
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ===================================================
   Breadcrumb
   =================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted-text-color);
}

.breadcrumb-item a {
    color: var(--muted-text-color);
    transition: color var(--transition-speed) ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--border-color);
    font-size: 0.75rem;
}

/* ===================================================
   Page Header
   =================================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--muted-text-color);
    margin-top: 0.25rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* ===================================================
   Modals
   =================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.modal-backdrop.active {
    opacity: 1;
}

.modal {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition-speed) ease;
}

.modal-sm {
    max-width: 400px;
}

.modal-md {
    max-width: 560px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}

.modal-backdrop.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--muted-text-color);
    border-radius: 6px;
    line-height: 1;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* ===================================================
   Dropdown
   =================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 9997;
    padding: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-speed) ease;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    border-radius: calc(var(--border-radius) - 2px);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

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

.dropdown-item.danger:hover {
    background-color: color-mix(in srgb, var(--danger-color) 10%, transparent);
}

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

.dropdown-header {
    padding: 0.375rem 0.75rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===================================================
   Tabs
   =================================================== */
.tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-text-color);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ===================================================
   Progress
   =================================================== */
.progress {
    background-color: color-mix(in srgb, var(--primary-color) 15%, var(--background-color));
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.progress-bar.success {
    background-color: var(--success-color);
}

.progress-bar.danger {
    background-color: var(--danger-color);
}

.progress-bar.warning {
    background-color: var(--warning-color);
}

/* ===================================================
   Loading Spinner
   =================================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

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

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--background-color), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* ===================================================
   Empty States
   =================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--muted-text-color);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--muted-text-color);
    max-width: 300px;
    line-height: 1.5;
}

/* ===================================================
   Team Cards
   =================================================== */
.team-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-style);
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.team-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-color);
    display: block;
}

.team-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.team-card-title {
    font-size: 0.8125rem;
    color: var(--muted-text-color);
}

.team-card-dept {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ===================================================
   Notification Items
   =================================================== */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--hover-color);
}

.notification-item.unread {
    background-color: color-mix(in srgb, var(--primary-color) 4%, var(--card-background));
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.notification-item {
    position: relative;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--muted-text-color);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--muted-text-color);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===================================================
   Auth Pages
   =================================================== */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--background-color);
}

.auth-left {
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.auth-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.auth-left-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    backdrop-filter: blur(10px);
}

.auth-left-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.auth-left-text {
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 320px;
}

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--card-background);
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-logo {
    height: 40px;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.375rem;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

/* ===================================================
   Profile Page
   =================================================== */
.profile-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 70%, var(--info-color)));
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    position: relative;
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -40px;
    left: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--card-background);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.profile-info {
    padding: 3rem 1.5rem 1.5rem;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

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

/* ===================================================
   Color Swatch
   =================================================== */
.color-swatch-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    cursor: pointer;
}

/* ===================================================
   Utilities
   =================================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

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

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

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

.text-info {
    color: var(--info-color) !important;
}

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

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.bg-card {
    background-color: var(--card-background) !important;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.flex-1 {
    flex: 1;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.w-full {
    width: 100%;
}

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

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

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

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

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

.fs-sm {
    font-size: 0.8125rem;
}

.fs-xs {
    font-size: 0.75rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.rounded {
    border-radius: var(--border-radius);
}

.rounded-full {
    border-radius: 999px;
}

.overflow-hidden {
    overflow: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .app-main {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: block;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .app-content {
        padding: 1.25rem;
    }

    .navbar-search {
        display: none;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* ===================================================
   Print
   =================================================== */
@media print {

    .app-sidebar,
    .app-navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0;
    }

    .app-content {
        padding: 0;
    }

    body {
        color: black;
        background: white;
    }
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.tabs-container {}

.tabs-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.settings-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.settings-card-header {
    padding: 1.5rem 1.75rem 0;
}

.settings-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.settings-card-header p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.settings-card-body {
    padding: 1.75rem;
}

.settings-card-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Color grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.color-setting-item .form-label {
    margin-bottom: 0.4rem;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.color-hex-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.theme-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.theme-preview-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preview-chip {
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

/* Logo grid */
.logo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.logo-upload-item {}

.logo-preview-box {
    width: 100%;
    aspect-ratio: 3/2;
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: var(--hover);
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--btn-radius);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
}

.file-upload-label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.file-upload-label input[type="file"] {
    display: none;
}

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

/* Range inputs */
.range-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-input-group input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
}

.range-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* Font preview */
.font-preview-box {
    background: var(--hover);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.font-preview-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.font-preview-body {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.font-preview-small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* UI preview */
.ui-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.ui-preview-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-mini-preview {
    padding: 0.75rem 1.5rem;
    background: var(--hover);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Mode options */
.mode-option-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 560px;
}

.mode-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.mode-option-card:hover {
    border-color: var(--primary);
}

.mode-option-card.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.mode-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-option-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.mode-option-body {
    flex: 1;
}

.mode-option-body strong {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.mode-option-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.mode-option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: all var(--transition);
}

.mode-option-card.active .mode-option-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   NOTIFICATIONS PAGE
   ============================================================ */
.notif-stats-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.notif-stat-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.83rem;
}

.notif-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.notif-stat-dot.all {
    background: var(--text-muted);
}

.notif-stat-dot.unread {
    background: var(--primary);
}

.notif-stat-dot.read {
    background: var(--success);
}

.notif-filter-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.notif-filter-btn {
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--border);
    background: transparent;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

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

.notif-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.notif-list {}

.notif-list-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.notif-list-item:last-child {
    border-bottom: none;
}

.notif-list-item:hover {
    background: var(--hover);
}

.notif-list-item.unread {
    background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.notif-list-item.unread:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.notif-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-type-success {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.notif-type-danger,
.notif-type-error {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
}

.notif-type-warning {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--warning);
}

.notif-type-info {
    background: color-mix(in srgb, var(--info) 12%, transparent);
    color: var(--info);
}

.notif-list-body {
    flex: 1;
    min-width: 0;
}

.notif-list-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.notif-list-message {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.notif-list-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.35rem;
}

.notif-time,
.notif-read-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.notif-list-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

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

.btn-icon-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.badge-xs {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}

/* ============================================================
   TEAM PAGE
   ============================================================ */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-mini-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1rem 1.5rem;
    min-width: 130px;
}

.stat-mini-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-mini-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.team-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all var(--transition);
}

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

.team-card-actions {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.team-card:hover .team-card-actions {
    opacity: 1;
}

.team-card-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.team-card-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.team-card-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.team-card-status-dot.active {
    background: var(--success);
}

.team-card-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.team-card-role {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.team-card-bio {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0.75rem 0;
}

.team-card-contact {
    margin: 0.75rem 0;
}

.team-card-contact-link {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.team-card-contact-link:hover {
    color: var(--primary);
}

.team-card-socials {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.social-link-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.social-link-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   BREADCRUMB COMPONENT
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color var(--transition);
}

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

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

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
    display: flex;
    align-items: center;
}

.breadcrumb-home {}

/* ============================================================
   ALERT COMPONENT
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    margin-bottom: 1rem;
    position: relative;
}

.alert-success {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border-color: color-mix(in srgb, var(--success) 25%, transparent);
    color: color-mix(in srgb, var(--success) 80%, #000);
}

.alert-danger {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border-color: color-mix(in srgb, var(--danger) 25%, transparent);
    color: color-mix(in srgb, var(--danger) 80%, #000);
}

.alert-warning {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
    color: color-mix(in srgb, var(--warning) 80%, #000);
}

.alert-info {
    background: color-mix(in srgb, var(--info) 10%, transparent);
    border-color: color-mix(in srgb, var(--info) 25%, transparent);
    color: color-mix(in srgb, var(--info) 80%, #000);
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-body {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.alert-message {
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert-close {
    position: absolute;
    top: 0.75rem;
    right: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    display: flex;
    align-items: center;
    color: inherit;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================================
   MODAL SIZES
   ============================================================ */
.modal-md {
    max-width: 640px;
}

/* ============================================================
   EXTRA BUTTON VARIANTS
   ============================================================ */
.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

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

/* ============================================================
   FORM CHECK
   ============================================================ */
.form-check-group {
    display: flex;
    align-items: center;
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
}

.form-check {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================================
   DARK MODE ADDITIONS
   ============================================================ */
[data-theme="dark"] .mode-option-card.active {
    background: color-mix(in srgb, var(--primary) 15%, transparent);
}

[data-theme="dark"] .notif-list-item.unread {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

[data-theme="dark"] .logo-preview-box {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .font-preview-box {
    background: rgba(255, 255, 255, 0.04);
}
/* ============================================================
   PAYMENT GATEWAY SETTINGS — Missing classes fix
   ============================================================ */

/* Two-column form grid (used in payment gateway tab) */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* form-input: styled like form-control for gateway fields */
.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--card-background);
    border: 1.5px solid var(--border-color);
    border-radius: var(--input-radius, 8px);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
}

.form-input::placeholder {
    color: var(--muted-text-color);
    opacity: 0.7;
}

/* form-select: dropdown variant */
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

/* form-hint under gateway inputs */
.form-hint {
    font-size: 0.78rem;
    color: var(--muted-text-color);
    margin-top: 0.3rem;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Gateway status badge strip */
.gateway-status-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Mode toggle highlight: sandbox vs live credential sections */
.gateway-cred-section {
    padding: 1rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--card-radius, 12px);
    background: var(--card-background);
    margin-bottom: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
}

.gateway-cred-section.active-mode {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 4%, var(--card-background));
}

.gateway-cred-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-text-color);
    margin: 0 0 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gateway-cred-section.active-mode .gateway-cred-section-title {
    color: var(--primary-color);
}

.gateway-mode-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    background: var(--primary-color);
    color: #fff;
    letter-spacing: 0.04em;
}

/* Toggle switch for enable/disable */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    display: inline-block;
}

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

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 99px;
    transition: background 0.2s;
    cursor: pointer;
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked ~ .toggle-track {
    background: var(--primary-color);
}

.toggle-switch input:checked ~ .toggle-track::after {
    transform: translateX(18px);
}

.toggle-switch-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Dark mode adjustments for gateway fields */
[data-theme="dark"] .form-input {
    background: color-mix(in srgb, var(--card-background) 90%, #000);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .gateway-cred-section {
    background: color-mix(in srgb, var(--card-background) 80%, #000);
}
