/* ===================================================================
   Cold Stone Creamery - Unified Dashboard Styles
   ================================================================= */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== COLD STONE OFFICIAL COLORS ===== */
:root {
    /* Primary Brand Colors */
    --coldstone-brown: #5D4037;
    --coldstone-brown-dark: #3E2723;
    --coldstone-brown-light: #8D6E63;
    --coldstone-red: #C62828;
    --coldstone-red-dark: #B71C1C;
    --coldstone-red-light: #E57373;
    --coldstone-cream: #FFF8DC;
    --coldstone-cream-dark: #F5E6C8;

    /* Status Colors */
    --status-success: #28a745;
    --status-warning: #ffc107;
    --status-error: #dc3545;
    --status-info: #17a2b8;

    /* Gray Scale */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Theme Variables (can be overridden) */
    --primary-color: var(--coldstone-brown);
    --primary-dark: var(--coldstone-brown-dark);
    --primary-light: var(--coldstone-brown-light);
    --accent-color: var(--coldstone-red);
    --accent-dark: var(--coldstone-red-dark);
    --accent-light: var(--coldstone-red-light);
    --bg-gradient-start: var(--coldstone-brown);
    --bg-gradient-mid: var(--coldstone-brown-light);
    --bg-gradient-end: var(--coldstone-red);
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-700);
    --link-color: #B71C1C;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --primary-color: var(--coldstone-brown-light);
    --primary-dark: var(--coldstone-brown);
    --primary-light: #A1887F;
    --accent-color: var(--coldstone-red-light);
    --accent-dark: var(--coldstone-red);
    --accent-light: #EF9A9A;
    --bg-gradient-start: #1F2937;
    --bg-gradient-mid: #374151;
    --bg-gradient-end: #4B5563;
    --card-bg: rgba(31, 41, 55, 0.98);
    --text-primary: #F9FAFB;
    --text-secondary: #E5E7EB;
    --link-color: #EF9A9A;
}

/* Dark theme: Footer */
[data-theme="dark"] .footer {
    background: rgba(31, 41, 55, 0.9);
    color: #E5E7EB;
}

[data-theme="dark"] .footer p {
    color: #D1D5DB;
}

[data-theme="dark"] .footer p:first-child {
    color: #F3F4F6;
}

[data-theme="dark"] .footer p:last-child {
    color: #9CA3AF;
}

/* Dark theme: Form elements */
[data-theme="dark"] .form-select,
[data-theme="dark"] select {
    background-color: #374151;
    color: #E5E7EB;
    border-color: #4B5563;
}

[data-theme="dark"] .form-select:focus,
[data-theme="dark"] select:focus {
    border-color: #60A5FA;
    outline-color: #60A5FA;
}

/* Dark theme: Badge secondary */
[data-theme="dark"] .badge-secondary {
    background-color: #4B5563;
    color: #E5E7EB;
}

/* ===== BASE STYLES ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg,
                var(--bg-gradient-start) 0%,
                var(--bg-gradient-mid) 50%,
                var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* ===== LINK STYLES ===== */
a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== GLASS CARD BASE ===== */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.dashboard-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.coldstone-logo {
    height: 55px;
    width: auto;
}

.header-text h1 {
    font-size: 24px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
    text-align: right;
}

.header-text .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===== NAVIGATION ===== */
.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 15px;
    color: #FFFFFF;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-breadcrumb a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.nav-breadcrumb a:hover {
    color: var(--coldstone-cream);
    text-decoration: underline;
}

.nav-breadcrumb .separator {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== DASHBOARD CATEGORIES ===== */
.category-section {
    margin-bottom: 2.5rem;
}

.category-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Toggle animation styles */
.location-toggle {
    transition: transform 0.1s ease, box-shadow 0.3s ease;
}

.location-toggle:active {
    transform: scale(0.98);
}

.category-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.category-header h2 {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-count {
    background: var(--primary-color);
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    min-width: 45px;
    text-align: center;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    padding: 2rem;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }
.dashboard-card:nth-child(5) { animation-delay: 0.5s; }
.dashboard-card:nth-child(6) { animation-delay: 0.6s; }

.dashboard-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    display: block;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.dashboard-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.dashboard-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.meta-badge.inventory {
    background: rgba(93, 64, 55, 0.1);
    color: var(--coldstone-brown);
}

.meta-badge.sales {
    background: rgba(198, 40, 40, 0.1);
    color: var(--coldstone-red);
}

.meta-badge.labor {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 3rem;
}

.footer p {
    margin: 0.25rem 0;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ===== RESPONSIVE ===== */

/* Tablet and below */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .header-text h1 {
        font-size: 20px;
        text-align: center;
    }

    .header-text .subtitle {
        font-size: 13px;
    }

    .coldstone-logo {
        max-width: 60px;
        margin-bottom: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-header h2 {
        font-size: 22px;
    }

    .category-count {
        font-size: 16px;
        padding: 0.4rem 0.8rem;
    }

    .dashboard-card {
        padding: 1.25rem;
    }

    /* Inventory-specific mobile improvements */
    .category-header {
        padding: 1rem 1.25rem;
    }

    .category-header-top {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .category-section {
        margin-bottom: 1.5rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 8px;
        font-size: 14px;
    }

    .dashboard-grid {
        gap: 0.75rem;
    }

    .category-header {
        padding: 1rem;
        border-radius: 16px;
    }

    .category-header h2 {
        font-size: 18px;
        gap: 0.5rem;
    }

    .category-count {
        font-size: 14px;
        padding: 0.35rem 0.7rem;
        min-width: 35px;
    }

    .glass-card {
        border-radius: 16px;
        padding: 1rem !important;
    }

    .dashboard-card {
        padding: 1rem;
    }

    /* Make touch targets larger for mobile */
    .category-header.glass-card[onclick] {
        padding: 1.25rem 1rem;
        min-height: 60px;
    }

    /* Reduce font sizes in cards */
    .glass-card h3 {
        font-size: 16px !important;
    }

    .glass-card h2 {
        font-size: 18px !important;
    }

    /* Smaller product images on mobile */
    .glass-card img {
        width: 45px !important;
        height: 45px !important;
    }

    /* Adjust spacing in inventory cards */
    .glass-card [style*="padding: 0.75rem"] {
        padding: 0.6rem !important;
    }

    /* Smaller build quantity display */
    .glass-card [style*="font-size: 24px"] {
        font-size: 20px !important;
    }

    /* Adjust summary stats for mobile */
    .dashboard-grid[style*="margin-bottom: 2rem"] .glass-card {
        padding: 1rem !important;
    }

    .dashboard-grid[style*="margin-bottom: 2rem"] [style*="font-size: 36px"] {
        font-size: 28px !important;
    }

    .dashboard-grid[style*="margin-bottom: 2rem"] [style*="font-size: 14px"] {
        font-size: 13px !important;
    }

    /* Optimize banner on mobile */
    .glass-card[style*="text-align: center"][style*="padding: 1rem"] {
        padding: 0.75rem !important;
    }

    .glass-card[style*="text-align: center"] [style*="font-size: 14px"] {
        font-size: 13px !important;
    }

    /* Better navigation breadcrumb on mobile */
    .nav-breadcrumb {
        font-size: 13px;
        gap: 0.35rem;
        flex-wrap: wrap;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    body {
        padding: 6px;
        font-size: 13px;
    }

    .category-header h2 {
        font-size: 16px;
    }

    .category-count {
        font-size: 13px;
        padding: 0.3rem 0.6rem;
        min-width: 30px;
    }

    .glass-card {
        padding: 0.85rem !important;
    }

    .glass-card img {
        width: 40px !important;
        height: 40px !important;
    }

    .glass-card h3 {
        font-size: 15px !important;
    }

    .dashboard-grid[style*="margin-bottom: 2rem"] [style*="font-size: 36px"] {
        font-size: 24px !important;
    }
}

/* ============================================================================
   USER MANAGEMENT STYLES
   ============================================================================ */

.users-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filters-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: linear-gradient(135deg, #5D4037 0%, #C62828 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.users-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.users-table tbody tr:hover {
    background: #f9f9f9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-email {
    font-weight: 500;
    color: #333;
}

.user-name {
    font-size: 12px;
    color: #666;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-owner {
    background: #FFD700;
    color: #000;
}

.role-admin {
    background: #C62828;
    color: white;
}

.role-manager {
    background: #1976D2;
    color: white;
}

.role-viewer {
    background: #757575;
    color: white;
}

.role-office {
    background: #10b981;
    color: white;
}

.role-cake_decorator {
    background: #8b5cf6;
    color: white;
}

.location-badge {
    display: inline-block;
    padding: 3px 10px;
    margin-right: 4px;
    background: #E3F2FD;
    color: #1976D2;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-inactive {
    background: #FFEBEE;
    color: #C62828;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

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

.text-muted {
    color: #999;
    font-style: italic;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* Add padding to forms inside modals */
.modal-content form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #C62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.form-group input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.error-message {
    color: #C62828;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.btn-primary {
    background: linear-gradient(135deg, #5D4037 0%, #C62828 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: #C62828;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45A049;
}

.warning-text {
    color: #C62828;
    font-style: italic;
    font-size: 14px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    animation: slideInRight 0.3s;
}

.toast-content {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
}

.toast.success .toast-content {
    border-left: 4px solid #4CAF50;
}

.toast.error .toast-content {
    border-left: 4px solid #C62828;
}

#toast-icon {
    font-size: 20px;
}

#toast-message {
    font-size: 14px;
    color: #333;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
    }

    .users-table {
        font-size: 12px;
    }

    .users-table th,
    .users-table td {
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* ========================================================================
   COMPACT QUICKLINKS BAR
   Icon-only navigation with hover tooltips
   ======================================================================== */

.quicklinks-bar {
    position: fixed;
    top: 80px;  /* Below header */
    right: 20px;
    z-index: 900;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.quicklinks-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quicklink-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--background);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quicklink-btn:hover {
    background: var(--primary-light);
    transform: translateX(-3px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quicklink-btn:active {
    transform: translateX(-3px) scale(0.98);
}

.quicklink-icon {
    font-size: 24px;
    line-height: 1;
}

/* Tooltip on hover */
.quicklink-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 54px;  /* Position to left of icon */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.92);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    max-width: 250px;
    white-space: normal;
}

/* Tooltip arrow */
.quicklink-btn::after {
    content: '';
    position: absolute;
    right: 48px;  /* Align with tooltip */
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Show tooltip on hover */
.quicklink-btn:hover::before,
.quicklink-btn:hover::after {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .quicklinks-bar {
        position: fixed;
        bottom: 20px;
        top: auto;
        right: 20px;
        left: 20px;
        width: auto;
    }

    .quicklinks-container {
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .quicklink-btn {
        width: 40px;
        height: 40px;
    }

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

    /* Mobile tooltips appear above */
    .quicklink-btn::before {
        right: auto;
        bottom: 50px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .quicklink-btn::after {
        right: auto;
        bottom: 44px;
        top: auto;
        left: 50%;
        transform: translateX(-50%) rotate(-90deg);
    }
}

/* Dark mode support */
[data-theme="dark"] .quicklinks-bar {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================================================
   MOBILE BOTTOM NAVIGATION (iOS/Android Style)
   Native app-style navigation for mobile devices
   ======================================================================== */

/* Hide by default on desktop */
.mobile-bottom-nav {
    display: none;
}

/* Show only on mobile */
@media (max-width: 768px) {
    /* Hide quicklinks bar on mobile */
    .quicklinks-bar {
        display: none;
    }

    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        padding: 8px 0 max(8px, env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: stretch;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 8px;
        text-decoration: none;
        color: var(--text-secondary);
        background: none;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        flex: 1;
        max-width: 80px;
        position: relative;
    }

    .mobile-nav-item:active {
        transform: scale(0.95);
    }

    .mobile-nav-icon {
        font-size: 24px;
        line-height: 1;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }

    .mobile-nav-label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
    }

    /* Active state */
    .mobile-nav-item.active {
        color: var(--primary-color);
    }

    .mobile-nav-item.active .mobile-nav-icon {
        transform: scale(1.1);
    }

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

    /* Add bottom padding to body to prevent content from being hidden */
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    /* Adjust dashboard content */
    .dashboard-content {
        margin-bottom: 20px;
    }
}

/* Dark mode support */
[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mobile-nav-item.active {
    color: var(--accent-light);
}

[data-theme="dark"] .mobile-nav-item.active::before {
    background: var(--accent-light);
}

[data-theme="dark"] .quicklink-btn {
    background: rgba(50, 50, 50, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .quicklink-btn:hover {
    background: rgba(93, 64, 55, 0.9);
}

/* ========================================
   IMPERSONATION BANNER & CONTROLS
   ======================================== */

/* Impersonation Banner */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    border-bottom: 3px solid #e03131;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 12px 0;
    animation: slideDown 0.3s ease-out;
}

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

.impersonation-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.impersonation-icon {
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.impersonation-text {
    font-size: 14px;
    line-height: 1.4;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.3);
    margin-left: 8px;
}

.impersonation-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.impersonation-timer {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-family: monospace;
}

.btn-exit-impersonation {
    background: white;
    color: #e03131;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-exit-impersonation:hover {
    background: #e03131;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-exit-impersonation:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.btn-exit-impersonation .btn-icon {
    font-size: 16px;
}

/* Read-only indicators when impersonating */
body.impersonating button[type="submit"],
body.impersonating input[type="submit"],
body.impersonating .btn-primary:not(.btn-exit-impersonation) {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

body.impersonating button[type="submit"]::after,
body.impersonating input[type="submit"]::after {
    content: ' (Read-Only)';
    font-size: 0.8em;
    color: #868e96;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .impersonation-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .impersonation-actions {
        width: 100%;
        justify-content: space-between;
    }

    .impersonation-text {
        font-size: 13px;
    }

    .btn-exit-impersonation {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .impersonation-banner {
    background: linear-gradient(135deg, #c92a2a 0%, #e03131 100%);
    border-bottom-color: #a61e1e;
}
/* Cache bust Sat Nov 15 20:02:04 PST 2025 */
