/* Instrument Sans - Professional typography */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');

/* Phosphor Icons - Professional icon library */
@import url('https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/regular/style.css');
@import url('https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/bold/style.css');
@import url('https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/fill/style.css');

/* ========================================
   Color Palette - CSS Custom Properties
   ======================================== */
:root {
    /* Primary colors - customizable via settings */
    --color-background: #FFFFF4;
    --color-primary: #2B3C22;
    --color-accent: #FFADC2;
    --color-logo-background: #27421E;

    /* Derived colors (solid colors, no transparency) */
    --color-primary-light: #4A5F3D;
    --color-primary-dark: #1A2515;
    --color-accent-light: #FFCBD8;
    --color-accent-dark: #E08CA3;

    /* Semantic colors */
    --color-surface: #ffffff;
    --color-background-secondary: #f8fafc;
    --color-border: #e2e8f0;
    --color-text: #1a202c;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-accent-hover: #ff8fab;

    /* Status colors */
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-error: #dc2626;
    --color-info: #2563eb;
}

/* Global typography and background */
body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-background);
}

/* Ensure all form elements inherit the font */
input,
select,
textarea,
button {
    font-family: inherit;
}

/* Icon utility classes */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
}

.icon-sm {
    font-size: 20px;
}

.icon-lg {
    font-size: 28px;
}

.icon-xl {
    font-size: 36px;
}

/* Default Phosphor icon styling - make icons bigger globally */
.ph {
    font-size: 1.25em;
    vertical-align: middle;
}

/* Navigation icons */
.nav-icon .ph,
.mobile-nav-icon .ph {
    font-size: 22px;
}

/* Card icons */
.card-icon .ph {
    font-size: 24px;
}

/* Quick action button icons */
.quick-action-btn .ph {
    font-size: 20px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--color-primary);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
}

/* Minimized sidebar state */
.sidebar.minimized {
    width: 0;
    transform: translateX(0);
    background: transparent;
    border-right: none;
    overflow: hidden;
}

.sidebar.minimized .sidebar-header,
.sidebar.minimized .sidebar-nav {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Expand button for minimized sidebar */
.expand-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(43, 60, 34, 0.25);
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.expand-btn:hover {
    background: var(--color-primary-light);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(43, 60, 34, 0.35);
}

.expand-btn.show {
    display: flex;
}

/* Hide the pseudo-element expand tab */
.sidebar.minimized::after {
    display: none;
}

/* Hide minimize button when minimized */
.sidebar.minimized .minimize-btn {
    opacity: 0;
    visibility: hidden;
}

.sidebar.minimized .sidebar-logo {
    width: 36px;
    height: 36px;
    font-size: 14px;
    background: var(--color-logo-background);
}

/* All navigation content is hidden when minimized */
.sidebar.minimized .sidebar-title,
.sidebar.minimized .nav-section-title,
.sidebar.minimized .nav-text,
.sidebar.minimized .nav-shortcut,
.sidebar.minimized .nav-item,
.sidebar.minimized .nav-icon {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Minimize button */
.minimize-btn {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 1001;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.minimize-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.minimize-btn.minimized {
    right: -15px;
}



/* Remove the old hover expansion styles */
.sidebar.minimized:hover {
    width: 60px;
    transform: translateX(0);
    box-shadow: none;
}

.sidebar.minimized:hover .sidebar-header,
.sidebar.minimized:hover .sidebar-logo,
.sidebar.minimized:hover .sidebar-title,
.sidebar.minimized:hover .nav-section-title,
.sidebar.minimized:hover .nav-text,
.sidebar.minimized:hover .nav-shortcut,
.sidebar.minimized:hover .nav-item,
.sidebar.minimized:hover .nav-item.active,
.sidebar.minimized:hover .nav-item.active::before,
.sidebar.minimized:hover .nav-icon {
    /* Reset all hover styles to maintain minimized state */
}

/* Main content adjustment for minimized sidebar */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: var(--color-background);
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-minimized {
    margin-left: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--color-logo-background);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 14px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 0 20px 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--color-accent);
    color: var(--color-primary);
    border-right: none;
}

.nav-item.active::before {
    display: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-text {
    flex: 1;
}

.nav-shortcut {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Main Content Area */


.search-bar {
    position: relative;
    max-width: 600px;
    margin: 16px auto 0;
    text-align: center;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(43, 60, 34, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
}

.search-shortcut {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.content-body {
    padding: 32px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

/* Mobile Responsive - Top Navigation */
@media (max-width: 768px), (max-width: 767px) {
    /* Hide desktop sidebar on mobile */
    .sidebar {
        display: none !important;
    }
    
    /* Ensure body and html don't interfere */
    body {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    html {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Hide desktop minimize/expand buttons */
    .minimize-btn,
    .expand-btn {
        display: none !important;
    }
    
    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0 !important;
    }
    
    .main-content.sidebar-minimized {
        margin-left: 0 !important;
    }
    
    /* Mobile Top Navigation */
    .mobile-top-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--color-primary) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        height: 60px !important;
    }

    .mobile-nav-brand {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-nav-logo {
        width: 32px;
        height: 32px;
        background: var(--color-logo-background);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-primary);
        font-weight: bold;
        font-size: 14px;
    }

    .mobile-nav-title {
        font-size: 18px;
        font-weight: 600;
        color: white;
        margin: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        color: white;
        font-size: 18px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }

    .mobile-menu-toggle.active {
        background: var(--color-accent);
        color: var(--color-primary);
        border-color: var(--color-accent);
    }

    /* Mobile Dropdown Menu */
    .mobile-dropdown-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-primary);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 999;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .mobile-dropdown-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* When dropdown is open, ensure content stays in place */
    .mobile-dropdown-menu.open + .mobile-overlay {
        display: block;
    }
    
    .mobile-nav-section {
        padding: 16px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-section:last-child {
        border-bottom: none;
    }

    .mobile-nav-section-title {
        padding: 0 20px 8px;
        font-size: 12px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: all 0.2s ease;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }

    .mobile-nav-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .mobile-nav-item.active {
        background: var(--color-accent);
        color: var(--color-primary);
        border-left: none;
    }
    
    .mobile-nav-icon {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }
    
    .mobile-nav-text {
        flex: 1;
    }
    
    /* Adjust main content to account for top nav */
    .main-content {
        padding-top: 60px !important;
        margin-left: 0 !important;
    }
    
    /* Ensure dashboard content has proper spacing */
    .dashboard-content {
        padding-top: 16px !important;
    }
    
    /* Ensure page headers don't go under the top nav */
    .page-header,
    .content-header {
        margin-top: 0 !important;
        padding: 16px 20px !important;
        border-bottom: 1px solid #e2e8f0;
        background: var(--color-background);
        text-align: center;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Mobile overlay for backdrop */
    .mobile-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        display: none;
    }
    
    .mobile-overlay.open {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .mobile-overlay {
        display: none;
    }
    
    .minimize-btn {
        display: flex;
    }
    
    /* Hide mobile top navigation on desktop */
    .mobile-top-nav,
    .mobile-dropdown-menu {
        display: none !important;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

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

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

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
} 

/* Center page titles on all pages */
.content-header,
.page-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    background: var(--color-background);
    text-align: center;
}

.greeting,
.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px 0;
    text-align: center;
}

.page-description {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* Mobile-specific overrides - placed at the end to ensure they take precedence */
@media (max-width: 768px) {
    .content-header,
    .page-header {
        margin-top: 0 !important;
        padding: 16px 20px !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .page-content {
        padding-top: 16px !important;
    }

    .dashboard-content {
        padding-top: 16px !important;
    }
}

/* ========================================
   Standardized Component System
   ======================================== */

/* ----------------------------------------
   Button System
   ---------------------------------------- */

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Size variants */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-md {
    padding: 12px 20px;
    font-size: 14px;
}

.btn-lg {
    padding: 15px 32px;
    font-size: 16px;
}

/* Color variants */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(43, 60, 34, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 60, 34, 0.35);
}

.btn-secondary {
    background: var(--color-background-secondary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

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

.btn-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #15803d 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

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

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, #b45309 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

/* Full width button */
.btn-block {
    width: 100%;
}

/* ----------------------------------------
   Card System
   ---------------------------------------- */

/* Base card */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* Card variants */
.card-elevated {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-elevated:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-flat {
    box-shadow: none;
}

.card-accent {
    border-left: 4px solid var(--color-primary);
}

/* Card sections */
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-background-secondary);
    border-radius: 0 0 12px 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

/* ----------------------------------------
   Modal System
   ---------------------------------------- */

/* Modal overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

/* When shown via JS (display: block -> flex) or via .active class */
.modal.active {
    display: flex;
}

/* Modal content */
.modal-content {
    background: var(--color-surface);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content-lg {
    max-width: 800px;
}

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

/* Modal header */
.modal-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Modal body */
.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

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

/* Modal mobile responsive */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 140px);
    }
}

/* ----------------------------------------
   Form System
   ---------------------------------------- */

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text);
}

.form-label-description {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Input base */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(43, 60, 34, 0.1);
}

/* Input states */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: var(--color-background-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Textarea */
.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Password wrapper */
.form-password-wrapper {
    position: relative;
}

.form-password-wrapper .form-input {
    padding-right: 44px;
}

.form-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-password-toggle:hover {
    color: var(--color-primary);
}

/* Form row (grid) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 480px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Help text */
.form-help {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.form-help.error {
    color: var(--color-error);
}

.form-help.success {
    color: var(--color-success);
}

/* Input group (for inputs with buttons) */
.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-group .form-input {
    flex: 1;
}

/* ----------------------------------------
   Alert/Status System
   ---------------------------------------- */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ----------------------------------------
   Badge System
   ---------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

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

/* ----------------------------------------
   Loading Spinner System
   ---------------------------------------- */

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

/* Spinner size variants */
.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

.spinner-xl {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Inline loading spinner with text (for buttons) */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.loading-spinner .spinner {
    margin-right: 0;
}

/* Loading container (centered loading state) */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--color-text-muted);
}

.loading-container p {
    margin: 16px 0 0 0;
    font-size: 14px;
}

/* Full-page loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 250, 252, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.loading-overlay .loading-content {
    text-align: center;
    color: var(--color-text-muted);
}

.loading-overlay .loading-text {
    margin-top: 16px;
    font-size: 14px;
}

/* Auth loading (full-page authentication check) */
.auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-loading-content {
    text-align: center;
    color: var(--color-text-muted);
}

.auth-loading-content p {
    margin: 16px 0 0 0;
    font-size: 14px;
}

/* Alias for auth-loading-spinner using standard spinner */
.auth-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ----------------------------------------
   Toast Notification System
   ---------------------------------------- */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.show {
    display: flex;
}

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

.toast-error {
    background: var(--color-error);
    color: white;
}

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

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

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
}

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

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

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

/* ----------------------------------------
   Status Badge Variants (for wallet/supplier status)
   ---------------------------------------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge-active,
.status-badge-success {
    background: #dcfce7;
    color: #166534;
}

.status-badge-inactive,
.status-badge-blocked,
.status-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge-pending,
.status-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ----------------------------------------
   Modal Notification System (Centered)
   ---------------------------------------- */

.modal-notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
}

.modal-notification-backdrop.show {
    display: block;
}

.modal-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 24px 32px;
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 16px;
    min-width: 300px;
    max-width: 500px;
    border: 2px solid;
}

.modal-notification.show {
    display: flex;
}

.modal-notification-success {
    border-color: var(--color-success);
    background: #dcfce7;
}

.modal-notification-error {
    border-color: var(--color-error);
    background: #fee2e2;
}

.modal-notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

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

.modal-notification-error .modal-notification-icon {
    color: var(--color-error);
}

.modal-notification-content {
    flex: 1;
}

.modal-notification-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.modal-notification-success .modal-notification-title {
    color: #166534;
}

.modal-notification-error .modal-notification-title {
    color: #991b1b;
}

.modal-notification-message {
    font-size: 14px;
    line-height: 1.5;
}

.modal-notification-success .modal-notification-message {
    color: #15803d;
}

.modal-notification-error .modal-notification-message {
    color: #dc2626;
}

.modal-notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
} 