/* ========================================
   BizziKit UI Design System v1.0
   Unified CSS for All Tools
   ======================================== */

/* ========================================
   CSS Variables - Design Tokens
   ======================================== */
:root {
    /* Monochrome Palette - Sophisticated Grayscale */
    --mono-white: #ffffff;
    --mono-50: #fafafa;
    --mono-100: #f5f5f5;
    --mono-200: #eeeeee;
    --mono-300: #e0e0e0;
    --mono-400: #bdbdbd;
    --mono-500: #9e9e9e;
    --mono-600: #757575;
    --mono-700: #616161;
    --mono-800: #424242;
    --mono-900: #212121;
    --mono-black: #000000;

    /* Primary Colors - Monochrome Only */
    --primary-50: #fafafa;
    --primary-100: #f5f5f5;
    --primary-200: #eeeeee;
    --primary-300: #e0e0e0;
    --primary-400: #bdbdbd;
    --primary-500: #757575;
    --primary-600: #616161;
    --primary-700: #424242;
    --primary-800: #212121;
    --primary-900: #000000;

    /* Neutral Grays */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Semantic Colors - Monochrome Variations */
    --success-50: #f5f5f5;
    --success-100: #e0e0e0;
    --success-500: #616161;
    --success-600: #424242;
    --success-700: #212121;

    --warning-50: #fafafa;
    --warning-100: #f5f5f5;
    --warning-500: #9e9e9e;
    --warning-600: #757575;
    --warning-700: #616161;

    --danger-50: #f5f5f5;
    --danger-100: #eeeeee;
    --danger-500: #424242;
    --danger-600: #212121;
    --danger-700: #000000;

    --info-50: #fafafa;
    --info-100: #f5f5f5;
    --info-500: #757575;
    --info-600: #616161;
    --info-700: #424242;

    /* Accent Colors - Subtle Monochrome */
    --accent-50: #fafafa;
    --accent-100: #f5f5f5;
    --accent-500: #9e9e9e;
    --accent-600: #757575;
    --accent-700: #616161;

    /* Spacing Scale - 4px Grid System */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */

    /* Border Radius - Modern Rounded Corners */
    --radius-sm: 0.375rem;    /* 6px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */
    --radius-2xl: 1.5rem;     /* 24px */
    --radius-3xl: 2rem;       /* 32px */
    --radius-full: 9999px;

    /* Shadows - Sophisticated Depth */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.15);

    /* Vertical Gradients - Monochrome Linear */
    --bg-gradient: linear-gradient(180deg, #000000 0%, #424242 50%, #757575 100%);
    --bg-gradient-light: linear-gradient(180deg, #000000 0%, #424242 50%, #757575 100%);
    --bg-gradient-card: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);

    /* Typography - Professional Font Stack */
    --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
    --font-primary: var(--font-sans);

    /* Font Sizes - Type Scale */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-modal: 1200;
    --z-popover: 1300;
    --z-tooltip: 1400;
}

/* ========================================
   Tooltip System
   ======================================== */
.label-with-tooltip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--mono-300);
    color: var(--mono-600);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}

.tooltip-icon:hover {
    background: var(--mono-400);
    color: var(--mono-800);
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--mono-900);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: var(--z-tooltip);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-align: left;
}

.tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--mono-900);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: calc(var(--z-tooltip) + 1);
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

[data-theme="dark"] .tooltip-icon {
    background: var(--mono-600);
    color: var(--mono-200);
}

[data-theme="dark"] .tooltip-icon:hover {
    background: var(--mono-500);
}

@media (max-width: 768px) {
    .tooltip-icon::after {
        left: auto;
        right: -10px;
        transform: none;
        max-width: 200px;
    }
    .tooltip-icon::before {
        left: auto;
        right: 10px;
        transform: none;
    }
}

/* ========================================
   Quick Tips Section
   ======================================== */
.quick-tips {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid var(--mono-200);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.quick-tips-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--mono-700);
    font-family: var(--font-sans);
}

.quick-tips-header:hover {
    background: rgba(0,0,0,0.02);
}

.quick-tips-toggle {
    transition: transform 0.3s ease;
}

.quick-tips.collapsed .quick-tips-toggle {
    transform: rotate(-90deg);
}

.quick-tips-content {
    padding: 0 20px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.quick-tips.collapsed .quick-tips-content {
    display: none;
}

.tip-card {
    background: white;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--mono-400);
    font-size: 13px;
    line-height: 1.5;
    color: var(--mono-700);
}

.tip-card strong {
    color: var(--mono-900);
}

[data-theme="dark"] .quick-tips {
    background: linear-gradient(135deg, #1f1f1f 0%, #171717 100%);
    border-color: #333;
}

[data-theme="dark"] .quick-tips-header {
    color: #e5e5e5;
}

[data-theme="dark"] .quick-tips-header:hover {
    background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .tip-card {
    background: #262626;
    color: #d4d4d4;
    border-left-color: #525252;
}

[data-theme="dark"] .tip-card strong {
    color: #fafafa;
}

/* ========================================
   Auto-Save Indicator
   ======================================== */
.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--mono-800);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    z-index: var(--z-sticky);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: var(--shadow-lg);
}

.save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator.saving {
    background: #3b82f6;
}

.save-indicator.saved {
    background: #10b981;
}

.save-indicator.error {
    background: #ef4444;
}

.save-indicator-icon {
    font-size: 16px;
}

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

.save-indicator.saving .save-indicator-icon {
    animation: spin 1s linear infinite;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-popover);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    background: var(--mono-800);
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    background: #10b981;
}

.toast.error,
.toast.danger {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

.toast.info {
    background: #3b82f6;
}

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

/* ========================================
   Common Button Styles
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

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

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--mono-800);
}

.btn-secondary {
    background: var(--mono-200);
    color: var(--mono-800);
}

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

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: var(--text-xs);
}

/* ========================================
   Common Form Styles
   ======================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--mono-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--mono-200);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--mono-400);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ========================================
   Common Card Styles
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-base);
    border: 1px solid var(--mono-100);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mono-200);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--mono-900);
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
}

.modal-close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: var(--mono-500);
    line-height: 1;
}

.modal-close:hover {
    color: var(--mono-800);
}

/* ========================================
   Stats Cards
   ======================================== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-base);
    border: 1px solid var(--mono-100);
}

.stat-card h3 {
    font-size: var(--text-sm);
    color: var(--mono-600);
    margin-bottom: 8px;
    font-weight: var(--font-medium);
}

.stat-card .value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--mono-900);
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .quick-tips-content {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */
[data-theme="dark"] {
    --mono-white: #171717;
    --mono-50: #1f1f1f;
    --mono-100: #262626;
    --mono-200: #333333;
    --mono-300: #404040;
    --mono-400: #525252;
    --mono-500: #737373;
    --mono-600: #a3a3a3;
    --mono-700: #d4d4d4;
    --mono-800: #e5e5e5;
    --mono-900: #fafafa;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal-content {
    background: var(--mono-100);
    border-color: var(--mono-300);
}

[data-theme="dark"] .tip-card {
    background: var(--mono-200);
}

/* Dark mode: Body and text */
[data-theme="dark"] body {
    background: #0a0a0a;
    color: #fafafa;
}

/* Dark mode: Headings */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #fafafa;
}

/* Dark mode: Paragraphs and text */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li {
    color: #d4d4d4;
}

/* Dark mode: Labels */
[data-theme="dark"] label {
    color: #e5e5e5;
}

/* Dark mode: Form inputs */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #262626;
    border-color: #404040;
    color: #fafafa;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #737373;
    outline: none;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #737373;
}

/* Dark mode: Tables */
[data-theme="dark"] table {
    border-color: #404040;
}

[data-theme="dark"] th {
    background: #262626;
    color: #fafafa;
    border-color: #404040;
}

[data-theme="dark"] td {
    background: #1f1f1f;
    color: #d4d4d4;
    border-color: #404040;
}

[data-theme="dark"] tr:hover td {
    background: #262626;
}

/* Dark mode: Buttons - Primary (keep light for contrast) */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] button[type="submit"],
[data-theme="dark"] .primary-btn {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] button[type="submit"]:hover,
[data-theme="dark"] .primary-btn:hover {
    background: #e5e5e5;
    color: #000000;
}

/* Dark mode: Buttons - Secondary */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .secondary-btn {
    background: #333333;
    color: #fafafa;
    border-color: #525252;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .secondary-btn:hover {
    background: #404040;
    color: #ffffff;
}

/* Dark mode: Buttons - Ghost/Outline */
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .btn-outline {
    background: transparent;
    color: #fafafa;
    border-color: #525252;
}

[data-theme="dark"] .btn-ghost:hover,
[data-theme="dark"] .btn-outline:hover {
    background: #333333;
}

/* Dark mode: Generic buttons */
[data-theme="dark"] button {
    color: #fafafa;
}

/* Dark mode: Success buttons */
[data-theme="dark"] .btn-success {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

[data-theme="dark"] .btn-success:hover {
    background: #059669;
}

/* Dark mode: Danger buttons */
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .delete-btn {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

[data-theme="dark"] .btn-danger:hover,
[data-theme="dark"] .delete-btn:hover {
    background: #dc2626;
}

/* Dark mode: Default .btn class */
[data-theme="dark"] .btn {
    background: #333333;
    color: #fafafa;
    border-color: #525252;
}

[data-theme="dark"] .btn:hover {
    background: #404040;
    color: #ffffff;
}

/* Dark mode: Small buttons */
[data-theme="dark"] .btn-sm {
    background: #333333;
    color: #fafafa;
}

[data-theme="dark"] .btn-sm:hover {
    background: #404040;
}

/* Dark mode: Tabs */
[data-theme="dark"] .tabs,
[data-theme="dark"] .tab-bar {
    background: #1f1f1f;
    border-color: #404040;
}

[data-theme="dark"] .tab,
[data-theme="dark"] .tab-button,
[data-theme="dark"] .tab-btn {
    color: #a3a3a3;
    background: transparent;
}

[data-theme="dark"] .tab:hover,
[data-theme="dark"] .tab-button:hover,
[data-theme="dark"] .tab-btn:hover {
    color: #fafafa;
    background: #333333;
}

[data-theme="dark"] .tab.active,
[data-theme="dark"] .tab-button.active,
[data-theme="dark"] .tab-btn.active {
    color: #fafafa;
    background: #333333;
    border-color: #525252;
}

/* Dark mode: Panels and sections */
[data-theme="dark"] .panel,
[data-theme="dark"] .section,
[data-theme="dark"] .container {
    background: #171717;
}

/* Dark mode: Links */
[data-theme="dark"] a {
    color: #60a5fa;
}

[data-theme="dark"] a:hover {
    color: #93c5fd;
}

/* Dark mode: Borders */
[data-theme="dark"] hr {
    border-color: #404040;
}

/* Dark mode: Code blocks */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: #262626;
    color: #e5e5e5;
}

/* Dark mode: Alerts and notices */
[data-theme="dark"] .alert,
[data-theme="dark"] .notice,
[data-theme="dark"] .message {
    background: #262626;
    border-color: #404040;
    color: #d4d4d4;
}

/* Dark mode: Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1f1f1f;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #404040;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #525252;
}

/* ========================================
   Accessibility (WCAG 2.1 AA)
   ======================================== */

/* Skip to main content link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
}
.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-decoration: none;
}

/* Visible focus indicators */
*:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}
/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ensure minimum contrast on status badges */
.badge, .status-badge, [class*="badge-"] {
    font-weight: 600;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .btn, button {
        border: 1px solid ButtonText;
    }
    .card {
        border: 1px solid CanvasText;
    }
}

/* ========================================
   Site Navigation Header
   ======================================== */
.site-nav {
    background: linear-gradient(180deg, #000000 0%, #171717 100%);
    padding: 12px 20px;
    position: sticky;
    top: 8px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin: 8px 12px 0 12px;
    border-radius: 16px;
}

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

.site-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.site-nav-logo:hover {
    opacity: 0.9;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 40px;
}

.site-nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.dark-mode-toggle .toggle-icon {
    font-size: 18px;
}

.dark-mode-toggle .toggle-text {
    font-size: 12px;
    font-weight: 500;
    display: none;
}

@media (min-width: 768px) {
    .dark-mode-toggle .toggle-text {
        display: inline;
    }
}

.site-nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Mobile responsive nav */
@media (max-width: 768px) {
    .site-nav {
        padding: 10px 16px;
    }
    
    .site-nav-container {
        flex-wrap: wrap;
    }
    
    .site-nav-links {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .site-nav-links a {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .site-nav-logo {
        font-size: 1.1rem;
    }
    
    .site-nav-links a {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ========================================
   PWA Install Banner
   ======================================== */
#pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: linear-gradient(135deg, #171717 0%, #2d2d2d 100%);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    align-items: center;
    gap: 16px;
    animation: slideUp 0.3s ease;
}

#pwa-install-banner.visible {
    display: flex;
}

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

.pwa-banner-content {
    flex: 1;
}

.pwa-banner-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.pwa-banner-text {
    font-size: 13px;
    opacity: 0.8;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-btn {
    background: white;
    color: #171717;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pwa-install-btn:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

.pwa-dismiss-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pwa-dismiss-btn:hover {
    background: rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
    #pwa-install-banner {
        flex-direction: column;
        text-align: center;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .pwa-banner-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Site Footer
   ======================================== */
.site-footer {
    background: linear-gradient(180deg, #171717 0%, #000000 100%);
    color: rgba(255,255,255,0.8);
    padding: 24px 20px;
    margin: 40px 12px 12px 12px;
    border-radius: 16px;
    text-align: center;
}

.site-footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.site-footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 480px) {
    .site-footer {
        padding: 20px 16px;
        margin: 32px 8px 8px 8px;
    }

    .site-footer-links {
        gap: 16px;
    }
}

/* ========================================
   Print Styles - Optimized for Paper Output
   ======================================== */
@media print {
    /* Reset to clean print defaults */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        font-size: 12pt;
        line-height: 1.4;
        background: white !important;
    }

    /* Hide non-essential elements */
    .site-nav,
    .site-footer,
    .dark-mode-toggle,
    .toast-container,
    .toast,
    .save-indicator,
    #pwa-install-banner,
    .shortcuts-modal,
    .modal:not(.print-modal),
    .tooltip-icon::after,
    .tooltip-icon::before,
    .quick-tips,
    button:not(.print-btn),
    .btn:not(.print-btn),
    input[type="button"],
    input[type="submit"],
    nav,
    header:not(.print-header),
    .no-print {
        display: none !important;
    }

    /* Show URLs for links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
        word-break: break-all;
    }

    /* Don't show URL for image links or buttons */
    a[href^="http"].no-url::after,
    a[href^="http"] img + ::after,
    .btn[href^="http"]::after {
        content: none;
    }

    /* Page breaks control */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    p, ul, ol, table, figure {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* Tables for invoices and reports */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    th, td {
        border: 1px solid #333 !important;
        padding: 8px !important;
        text-align: left;
    }

    th {
        font-weight: bold;
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Invoice-specific print styles */
    .invoice-preview,
    .invoice-content,
    .invoice-container {
        width: 100%;
        padding: 20px;
        border: none !important;
        box-shadow: none !important;
    }

    .invoice-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 2px solid #333 !important;
    }

    .invoice-logo img {
        max-height: 60px;
        max-width: 200px;
    }

    .invoice-title {
        font-size: 24pt;
        font-weight: bold;
    }

    .invoice-meta {
        margin-bottom: 30px;
    }

    .invoice-table {
        width: 100%;
        margin: 20px 0;
    }

    .invoice-table th {
        background: #e0e0e0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .invoice-totals {
        text-align: right;
        margin-top: 20px;
        padding-top: 15px;
        border-top: 2px solid #333 !important;
    }

    .invoice-total-row {
        margin-bottom: 5px;
    }

    .invoice-grand-total {
        font-size: 14pt;
        font-weight: bold;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #333 !important;
    }

    .invoice-watermark {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 72pt;
        color: #ddd !important;
        opacity: 0.3;
        pointer-events: none;
        z-index: 1000;
    }

    .invoice-notes,
    .invoice-terms {
        margin-top: 30px;
        padding-top: 15px;
        border-top: 1px solid #ccc !important;
        font-size: 10pt;
    }

    /* Time tracking / reports print styles */
    .timer-entries,
    .time-entries,
    .entries-list {
        page-break-inside: auto;
    }

    .timer-entry,
    .time-entry,
    .entry-item {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    .timer-entry:last-child,
    .time-entry:last-child,
    .entry-item:last-child {
        border-bottom: none;
    }

    /* Dashboard widgets print styles */
    .dashboard-grid,
    .widget-grid {
        display: block !important;
    }

    .dashboard-card,
    .widget,
    .card {
        border: 1px solid #ddd !important;
        padding: 15px;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    /* Calendar print styles */
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        border: 1px solid #333 !important;
    }

    .calendar-day {
        border: 1px solid #ddd !important;
        padding: 5px;
        min-height: 60px;
    }

    .calendar-event {
        font-size: 9pt;
        padding: 2px 4px;
        margin-bottom: 2px;
        background: #f0f0f0 !important;
        border-left: 3px solid #666 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Charts - show as tables instead */
    .chart-container,
    .weekly-chart,
    canvas {
        display: none !important;
    }

    .print-chart-data {
        display: block !important;
    }

    /* Stat cards */
    .stat-cards {
        display: flex !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    .stat-card {
        flex: 1;
        min-width: 150px;
        border: 1px solid #ddd !important;
        padding: 10px;
    }

    /* Inventory list print styles */
    .inventory-table,
    .inventory-list {
        width: 100%;
    }

    .inventory-item {
        page-break-inside: avoid;
    }

    /* Blog article print styles */
    .blog-content,
    .article-content,
    main {
        max-width: 100%;
        padding: 0;
    }

    article {
        page-break-inside: auto;
    }

    /* Force visible elements */
    .print-only {
        display: block !important;
    }

    /* Print header/footer */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    @page :first {
        margin-top: 2cm;
    }

    /* Ensure content fills page width */
    .container,
    .content,
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Footer info for printed pages */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #666 !important;
        border-top: 1px solid #ddd !important;
        padding-top: 5px;
    }
}

/* ========================================
   Blog Comments Section
   ======================================== */
.blog-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--mono-200);
}

.blog-comments h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    background: var(--mono-100);
    color: var(--mono-600);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.comment-form {
    background: var(--mono-50);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.comment-form .form-group {
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--mono-700);
    font-size: 14px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mono-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--mono-400);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

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

.comment-form button {
    background: var(--mono-900);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: var(--mono-700);
}

.comment-form .form-note {
    font-size: 12px;
    color: var(--mono-500);
    margin-top: 12px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment {
    background: white;
    border: 1px solid var(--mono-200);
    border-radius: 12px;
    padding: 20px;
}

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

.comment-author {
    font-weight: 600;
    color: var(--mono-900);
}

.comment-date {
    font-size: 13px;
    color: var(--mono-500);
}

.comment-text {
    color: var(--mono-700);
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--mono-100);
}

.comment-like,
.comment-delete {
    background: none;
    border: 1px solid var(--mono-200);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mono-600);
    transition: all 0.2s;
}

.comment-like:hover,
.comment-delete:hover {
    background: var(--mono-50);
    border-color: var(--mono-300);
}

.comment-like.liked {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.comment-delete {
    opacity: 0.5;
}

.comment-delete:hover {
    opacity: 1;
    background: #fef2f2;
    border-color: #fecaca;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: var(--mono-500);
    background: var(--mono-50);
    border-radius: 12px;
}

.comment-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.comment-toast.success {
    background: #10b981;
}

.comment-toast.error {
    background: #ef4444;
}

.comment-toast.fade-out {
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Dark mode for comments */
[data-theme="dark"] .blog-comments {
    border-color: var(--mono-700);
}

[data-theme="dark"] .comments-count {
    background: var(--mono-800);
    color: var(--mono-400);
}

[data-theme="dark"] .comment-form {
    background: var(--mono-800);
}

[data-theme="dark"] .comment-form label {
    color: var(--mono-300);
}

[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea {
    background: var(--mono-900);
    border-color: var(--mono-700);
    color: var(--mono-100);
}

[data-theme="dark"] .comment-form input:focus,
[data-theme="dark"] .comment-form textarea:focus {
    border-color: var(--mono-500);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

[data-theme="dark"] .comment {
    background: var(--mono-800);
    border-color: var(--mono-700);
}

[data-theme="dark"] .comment-author {
    color: var(--mono-100);
}

[data-theme="dark"] .comment-text {
    color: var(--mono-300);
}

[data-theme="dark"] .comment-actions {
    border-color: var(--mono-700);
}

[data-theme="dark"] .comment-like,
[data-theme="dark"] .comment-delete {
    border-color: var(--mono-700);
    color: var(--mono-400);
}

[data-theme="dark"] .comment-like:hover,
[data-theme="dark"] .comment-delete:hover {
    background: var(--mono-700);
    border-color: var(--mono-600);
}

[data-theme="dark"] .no-comments {
    background: var(--mono-800);
    color: var(--mono-400);
}

/* ========================================
   Mobile-Optimized Views
   ======================================== */

/* Touch-friendly tap targets (min 44px per WCAG) */
@media (max-width: 768px) {
    button, .btn, input[type="submit"], input[type="button"],
    select, .tab-button, a.btn {
        min-height: 44px;
        min-width: 44px;
    }

    input[type="text"], input[type="number"], input[type="email"],
    input[type="tel"], input[type="url"], input[type="date"],
    input[type="month"], input[type="password"], input[type="search"],
    textarea, select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 10px 12px;
    }

    /* Stack action buttons vertically */
    .action-buttons, .btn-group {
        flex-direction: column;
        gap: 8px;
    }
    .action-buttons .btn, .btn-group button, .btn-group .btn {
        width: 100%;
        justify-content: center;
    }

    /* Full-width modals */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh;
        overflow-y: auto;
        margin: 5vh auto;
    }

    /* Responsive tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 600px;
    }

    /* Tabs as scrollable row */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 4px;
        padding-bottom: 4px;
    }
    .tab-button {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 13px;
        padding: 8px 14px;
    }

    /* Hamburger nav */
    .site-nav-hamburger {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 4px 8px;
        min-height: 44px;
    }
    .site-nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .site-nav-links.mobile-open {
        display: flex;
    }
    .site-nav-links a {
        padding: 12px 16px;
        border-radius: 6px;
    }

    /* Reduce padding on main content */
    .container, .main-content, [class*="container"] {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Cards stack full width */
    .card, .stat-card {
        margin-bottom: 12px;
    }

    /* Print/export actions as floating bottom bar */
    .action-buttons {
        position: sticky;
        bottom: 0;
        background: var(--mono-white);
        padding: 12px;
        border-top: 1px solid var(--mono-200);
        z-index: 20;
        margin: 0 -12px;
        border-radius: 0;
    }
    [data-theme="dark"] .action-buttons {
        background: var(--mono-100);
        border-color: var(--mono-300);
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .site-nav-logo img {
        height: 24px !important;
    }
    .site-nav-logo {
        font-size: 1rem;
    }

    /* Compact card headers */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    h1, .card-title h1 { font-size: 1.3rem; }
    h2, .card-title h2 { font-size: 1.1rem; }

    /* Kanban columns stack */
    .kanban-board {
        flex-direction: column !important;
    }
    .kanban-column {
        min-width: 100% !important;
    }
}

/* Desktop nav: hide hamburger */
@media (min-width: 769px) {
    .site-nav-hamburger {
        display: none !important;
    }
}
