/*
============================================================
FILE: static/css/style.css
PROJECT: [COMPANY NAME] - ACH Secure Portal
PURPOSE: Complete glassmorphism UI stylesheet.
         Light professional theme — NO dark mode.
============================================================

CSS ARCHITECTURE:
-----------------
1.  CSS Variables (Design Tokens)
2.  Reset & Base Styles
3.  Background & Decorative Shapes
4.  Glass Components (cards, nav, footer)
5.  Navigation Bar
6.  Flash Messages
7.  Auth Pages (login, register, pending)
8.  Dashboard Layout
9.  Form Components
10. Tables
11. Buttons
12. Status Badges
13. Empty States & Errors
14. Utilities & Helpers
15. Responsive (Mobile)

GLASSMORPHISM RECIPE:
---------------------
- background: rgba(255, 255, 255, 0.6)
- backdrop-filter: blur(16px)
- border: 1px solid rgba(255, 255, 255, 0.3)
- border-radius: 16px
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08)

COLOR PALETTE (Light Professional):
------------------------------------
- Primary:   #4F46E5 (Indigo)
- Success:   #059669 (Emerald)
- Warning:   #D97706 (Amber)
- Danger:    #DC2626 (Red)
- Info:      #2563EB (Blue)
- BG Start:  #EEF2FF (Indigo-50)
- BG End:    #F0FDFA (Teal-50)
- Text:      #1E293B (Slate-800)
- Muted:     #64748B (Slate-500)
============================================================
*/


/* ==========================================================
   1. CSS VARIABLES (Design Tokens)
   Change these to rebrand the entire portal.
   ========================================================== */
:root {
    /* Primary Brand Colors */
    --primary:          #4F46E5;
    --primary-hover:    #4338CA;
    --primary-light:    #EEF2FF;
    --primary-rgb:      79, 70, 229;

    /* Status Colors */
    --success:          #059669;
    --success-light:    #ECFDF5;
    --warning:          #D97706;
    --warning-light:    #FFFBEB;
    --danger:           #DC2626;
    --danger-light:     #FEF2F2;
    --info:             #2563EB;
    --info-light:       #EFF6FF;

    /* Text Colors */
    --text-primary:     #1E293B;
    --text-secondary:   #475569;
    --text-muted:       #64748B;
    --text-light:       #94A3B8;

    /* Background */
    --bg-start:         #EEF2FF;
    --bg-mid:           #F5F3FF;
    --bg-end:           #F0FDFA;
    --bg-white:         #FFFFFF;

    /* Glass Properties */
    --glass-bg:         rgba(255, 255, 255, 0.65);
    --glass-border:     rgba(255, 255, 255, 0.35);
    --glass-shadow:     0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur:       16px;
    --glass-radius:     16px;

    /* Nav Glass */
    --nav-glass-bg:     rgba(255, 255, 255, 0.75);
    --nav-shadow:       0 4px 24px rgba(0, 0, 0, 0.06);

    /* Spacing */
    --space-xs:         0.25rem;
    --space-sm:         0.5rem;
    --space-md:         1rem;
    --space-lg:         1.5rem;
    --space-xl:         2rem;
    --space-2xl:        3rem;

    /* Typography */
    --font-family:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs:     0.75rem;
    --font-size-sm:     0.875rem;
    --font-size-base:   1rem;
    --font-size-lg:     1.125rem;
    --font-size-xl:     1.25rem;
    --font-size-2xl:    1.5rem;
    --font-size-3xl:    2rem;

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


/* ==========================================================
   2. RESET & BASE STYLES
   ========================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

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


/* ==========================================================
   3. BACKGROUND & DECORATIVE SHAPES
   Light gradient with floating blurred shapes.
   These create the depth for glassmorphism to work.
   ========================================================== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    z-index: -2;
}

.bg-shape {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    filter: blur(80px);
}

.bg-shape-1 {
    width: 500px;
    height: 500px;
    background: rgba(var(--primary-rgb), 0.15);
    top: -100px;
    right: -100px;
}

.bg-shape-2 {
    width: 400px;
    height: 400px;
    background: rgba(16, 185, 129, 0.12);
    bottom: -80px;
    left: -80px;
}

.bg-shape-3 {
    width: 300px;
    height: 300px;
    background: rgba(245, 158, 11, 0.10);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* ==========================================================
   4. GLASS COMPONENTS (Reusable Glass Panels)
   ========================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-shadow);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-title i {
    color: var(--primary);
}

.card-description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}


/* ==========================================================
   5. NAVIGATION BAR
   Frosted glass sticky navbar.
   ========================================================== */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--nav-shadow);
    padding: var(--space-sm) 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.nav-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-company-name {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-primary);
}

.nav-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 400;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.nav-link-logout {
    color: var(--danger);
}

.nav-link-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.nav-link-register {
    background: var(--primary);
    color: white !important;
    border-radius: 8px;
}

.nav-link-register:hover {
    background: var(--primary-hover);
    color: white !important;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-role-badge {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-user {
    background: var(--success-light);
    color: var(--success);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-sm);
}


/* ==========================================================
   6. FLASH MESSAGES
   Glassmorphism styled alert banners.
   Auto-dismiss handled by main.js.
   ========================================================== */
.flash-container {
    position: fixed;
    top: 72px;
    right: var(--space-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 420px;
    width: 100%;
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    animation: slideIn 0.3s ease-out;
    font-size: var(--font-size-sm);
}

.flash-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.flash-content i {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    color: inherit;
    opacity: 0.7;
    transition: var(--transition-fast);
    flex-shrink: 0;
    margin-left: var(--space-sm);
}

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

.flash-success {
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.25);
    color: var(--success);
}

.flash-danger {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
    color: var(--danger);
}

.flash-warning {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.25);
    color: var(--warning);
}

.flash-info {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--info);
}

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

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

.flash-message.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}


/* ==========================================================
   7. AUTH PAGES (Login, Register, Pending)
   Centered card layout for authentication flows.
   ========================================================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: var(--space-xl) var(--space-lg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: var(--space-2xl);
}

.auth-card-wide {
    max-width: 520px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-2xl);
    margin: 0 auto var(--space-md);
}

.auth-logo {
    height: 64px;
    width: auto;
    margin: 0 auto var(--space-md);
    display: block;
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--info-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 10px;
    font-size: var(--font-size-sm);
    color: var(--info);
    line-height: 1.5;
}

.auth-notice i {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-notice-secure {
    background: var(--success-light);
    border-color: rgba(5, 150, 105, 0.15);
    color: var(--success);
}


/* ==========================================================
   7b. PENDING PAGE SPECIFIC STYLES
   ========================================================== */
.pending-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--warning-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning);
    font-size: var(--font-size-3xl);
    margin: 0 auto var(--space-md);
}

.pending-content {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.pending-message {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
}

.pending-details {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.pending-steps {
    margin-bottom: var(--space-xl);
}

.pending-steps-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: 10px;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
}

.step-complete {
    background: var(--success-light);
}

.step-complete .step-number {
    background: var(--success);
    color: white;
}

.step-check {
    color: var(--success);
}

.step-active {
    background: var(--warning-light);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.step-active .step-number {
    background: var(--warning);
    color: white;
}

.step-waiting {
    color: var(--warning);
}

.step-upcoming {
    background: rgba(0, 0, 0, 0.02);
}

.step-upcoming .step-number {
    background: var(--text-light);
    color: white;
}

.step-future {
    color: var(--text-light);
}


/* ==========================================================
   8. DASHBOARD LAYOUT
   ========================================================== */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.dashboard-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.dashboard-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dashboard-title i {
    color: var(--primary);
}

.dashboard-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.dashboard-stats {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    border-radius: 12px;
    min-width: 80px;
    text-align: center;
}

.stat-count {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.stat-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-approved {
    background: var(--success-light);
    color: var(--success);
}

.stat-disabled {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-submissions {
    background: var(--primary-light);
    color: var(--primary);
}


/* ==========================================================
   9. FORM COMPONENTS
   ========================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

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

.form-group-inline {
    flex-direction: row;
    align-items: center;
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.required-star {
    color: var(--danger);
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
    background: white;
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input-readonly {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

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

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

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-input {
    padding-right: 44px;
}

.input-icon-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.input-icon-btn:hover {
    color: var(--primary);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-text {
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label-auth {
    padding: var(--space-md);
    background: var(--warning-light);
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-radius: 10px;
}

/* Password Strength Bar */
.password-strength {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: var(--transition);
}

.password-hint {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

.password-match-hint {
    font-size: var(--font-size-xs);
    min-height: 16px;
}

/* ACH Form Specific */
.ach-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}


/* ==========================================================
   10. TABLES
   ========================================================== */
.table-responsive {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--space-xl));
    padding: 0 var(--space-xl);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table thead th {
    background: rgba(0, 0, 0, 0.03);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.data-table thead th i {
    margin-right: 4px;
    font-size: var(--font-size-xs);
}

.data-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

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

/* Row highlights by user status */
.row-pending {
    background: rgba(217, 119, 6, 0.04);
}

.row-disabled {
    opacity: 0.6;
}

/* Cell types */
.td-id {
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.td-name {
    font-weight: 600;
}

.td-email, .td-practice {
    color: var(--text-secondary);
}

.td-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.td-ip {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.td-masked {
    font-family: 'Courier New', monospace;
}

.masked-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.masked-value i {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

.decrypted-value {
    color: var(--success) !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.td-actions {
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.action-buttons form {
    display: inline;
}


/* ==========================================================
   11. BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-full {
    width: 100%;
    padding: 12px 20px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    border-radius: 8px;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
    color: white;
}

/* Secondary */
.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.10);
    color: var(--text-primary);
}

/* Success */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
    color: white;
}

/* Warning */
.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #B45309;
    color: white;
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #B91C1C;
    color: white;
}

/* Unlock */
.btn-unlock {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

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

.btn-locked {
    background: var(--success-light) !important;
    color: var(--success) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
}

.btn-locked:hover {
    background: var(--success) !important;
    color: white !important;
}


/* ==========================================================
   12. STATUS BADGES
   ========================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-approved {
    background: var(--success-light);
    color: var(--success);
}

.status-disabled {
    background: var(--danger-light);
    color: var(--danger);
}


/* ==========================================================
   13. EMPTY STATES & ERRORS
   ========================================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    display: block;
    opacity: 0.4;
}

.empty-state p {
    font-size: var(--font-size-sm);
}

.error-card {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: var(--space-md);
    opacity: 0.6;
}

.error-code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.error-message {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}


/* ==========================================================
   14. FOOTER
   ========================================================== */
.glass-footer {
    text-align: center;
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    font-size: var(--font-size-xs);
    color: var(--text-light);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.main-content {
    min-height: calc(100vh - 180px);
}


/* ==========================================================
   15. RESPONSIVE (Mobile)
   ========================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 1px solid var(--glass-border);
        box-shadow: var(--nav-shadow);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-mobile-toggle {
        display: block;
    }

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

    .dashboard-stats {
        width: 100%;
        justify-content: space-between;
    }

    .form-row {
        flex-direction: column;
    }

    .auth-card {
        padding: var(--space-xl);
    }

    .flash-container {
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: none;
    }

    .data-table {
        font-size: var(--font-size-xs);
    }

    .data-table thead th,
    .data-table tbody td {
        padding: var(--space-xs) var(--space-sm);
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .action-buttons {
        gap: 2px;
    }

    .nav-user-info {
        padding: var(--space-sm) 0;
    }

    .stat-badge {
        min-width: 60px;
        padding: var(--space-xs) var(--space-sm);
    }

    .stat-count {
        font-size: var(--font-size-base);
    }

    /* Password form: stack 3-column to single column on mobile */
    .password-change-form .form-row {
        flex-direction: column;
    }

    /* Inline reset password: stack fields */
    .reset-pw-fields {
        flex-direction: column;
        width: 100%;
    }

    .form-input-sm {
        min-width: 100%;
    }

    /* Collapsible header hover: reset negative margin on mobile */
    .card-header-collapsible:hover {
        margin: calc(-1 * var(--space-lg));
        padding: var(--space-lg);
    }

}

@media (max-width: 480px) {
    .auth-container {
        padding: var(--space-md);
    }

    .auth-card {
        padding: var(--space-lg);
    }

    .dashboard-container {
        padding: var(--space-md);
    }

    .glass-card {
        padding: var(--space-lg);
    }

    .bg-shape-1 { width: 300px; height: 300px; }
    .bg-shape-2 { width: 200px; height: 200px; }
    .bg-shape-3 { width: 150px; height: 150px; }
}

/* ==========================================================
   9b. PASSWORD MANAGEMENT COMPONENTS (NEW)
   Collapsible password sections, inline reset forms,
   and 3-column form layout for password fields.
   ========================================================== */

/* Collapsible Card Header — clickable to expand/collapse */
.card-header-collapsible {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    margin-bottom: 0;
    transition: var(--transition-fast);
}

.card-header-collapsible:hover {
    background: rgba(var(--primary-rgb), 0.03);
    margin: calc(-1 * var(--space-xl));
    padding: var(--space-xl);
    border-radius: var(--glass-radius);
}

/* Collapse/Expand chevron button */
.btn-collapse {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: var(--font-size-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.btn-collapse:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

/* Collapsible content area */
.collapsible-section {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: var(--space-lg);
}

/* Password change form wrapper */
.password-change-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* 3-column form layout (for password fields) */
.form-group-third {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Inline reset password form (in user table rows) */
.reset-password-inline {
    margin-top: var(--space-sm);
    padding: var(--space-sm) 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.reset-pw-form {
    display: flex;
    align-items: center;
}

.reset-pw-fields {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
}

/* Smaller input for inline forms */
.form-input-sm {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
    outline: none;
    min-width: 140px;
}

.form-input-sm:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
    background: white;
}

.form-input-sm::placeholder {
    color: var(--text-light);
}

