/* 
 * Gorilla Sports Tools - Stylesheet
 * Based on Gorilla Sports Brand Guide 2026
 * 
 * Colors:
 * - Navy (Main): #0C1A33
 * - Yellow (CTA): #FACF2C
 * - Light Gray: #E7E7EA
 * - Coral Red: #FE5C5B
 * - Medium Gray: #90919B
 * - Success Green: #4CAF50
 */

:root {
    /* Brand Colors - Gorilla Sports */
    --navy: #0C1A33;
    --navy-light: #1A2D4D;
    --navy-dark: #060D1A;
    --yellow: #FACF2C;
    --yellow-hover: #E5BC28;
    --coral: #FE5C5B;
    --light-gray: #E7E7EA;
    --medium-gray: #90919B;
    --success: #4CAF50;
    --white: #FFFFFF;

    /* Semantic Colors */
    --bg-primary: var(--white);
    --bg-secondary: #F5F5F7;
    --bg-sidebar: var(--navy);
    --bg-card: var(--white);

    --text-primary: var(--navy);
    --text-secondary: var(--medium-gray);
    --text-on-dark: var(--white);
    --text-muted: #B0B0B5;

    --border-color: var(--light-gray);
    --border-color-dark: #D0D0D5;

    /* Spacing (8px grid) */
    --sidebar-width: 260px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* Border Radius - mostly sharp corners per brand guide */
    --radius-none: 0px;
    --radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(12, 26, 51, 0.08);
    --shadow-md: 0 4px 16px rgba(12, 26, 51, 0.12);
    --shadow-lg: 0 8px 32px rgba(12, 26, 51, 0.16);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ============================================
   SIDEBAR - Navy background per brand guide
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 180px;
    height: auto;
    /* Invert dark logo to white for navy background */
    filter: brightness(0) invert(1);
    transition: transform var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.02);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-sm) 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-none);
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    position: relative;
    font-weight: 500;
}

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

.nav-item.active {
    background: var(--yellow);
    color: var(--navy);
}

.nav-item.active .nav-icon {
    filter: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
    flex-shrink: 0;
}

.nav-item .nav-icon {
    stroke: rgba(255, 255, 255, 0.7);
}

.nav-item:hover .nav-icon {
    stroke: var(--white);
}

.nav-item.active .nav-icon {
    stroke: var(--navy);
}

.nav-text {
    font-weight: 500;
    font-size: 14px;
}

.nav-badge {
    position: absolute;
    right: 12px;
    background: var(--coral);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--spacing-sm) 0;
}

.sidebar-footer {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language Selector */
.language-selector-wrapper {
    margin-bottom: 12px;
}

.language-selector {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    font-family: inherit;
}

.language-selector:hover {
    border-color: var(--yellow);
}

.language-selector:focus {
    outline: none;
    border-color: var(--yellow);
}

.language-selector option {
    background: var(--navy);
    color: var(--white);
}

.health-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--medium-gray);
}

.health-dot.success { background: var(--success); }
.health-dot.warning { background: var(--yellow); }
.health-dot.danger { background: var(--coral); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--spacing-lg) var(--spacing-xl);
}

/* Page */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

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

.stat-card.warning {
    border-left: 4px solid var(--coral);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--navy);
    stroke-width: 2px;
}

.stat-card.warning .stat-icon {
    background: rgba(254, 92, 91, 0.1);
}

.stat-card.warning .stat-icon svg {
    stroke: var(--coral);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-md);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
}

.card-body {
    padding: var(--spacing-md);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-none);
    border-left: 3px solid var(--yellow);
}

.activity-icon {
    width: 18px;
    height: 18px;
    stroke: var(--success);
    stroke-width: 2px;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.activity-time {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Sync List */
.sync-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sync-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-none);
}

.sync-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

.sync-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-none);
    font-weight: 500;
}

.sync-status.success { 
    background: rgba(76, 175, 80, 0.15); 
    color: var(--success); 
}
.sync-status.pending { 
    background: rgba(250, 207, 44, 0.2); 
    color: #997D00; 
}
.sync-status.error { 
    background: rgba(254, 92, 91, 0.15); 
    color: var(--coral); 
}

/* ============================================
   UPLOAD GRID
   ============================================ */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.upload-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.upload-header-icon {
    width: 24px;
    height: 24px;
    stroke: var(--navy);
    stroke-width: 2px;
    flex-shrink: 0;
}

.upload-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
}

.upload-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.upload-zone {
    border: 2px dashed var(--border-color-dark);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--yellow);
    background: rgba(250, 207, 44, 0.05);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    cursor: pointer;
}

.upload-icon-large {
    width: 48px;
    height: 48px;
    stroke: var(--medium-gray);
    stroke-width: 1.5px;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.upload-zone:hover .upload-icon-large,
.upload-zone.drag-over .upload-icon-large {
    stroke: var(--yellow);
    transform: translateY(-2px);
}

.upload-text {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.upload-result {
    margin-top: var(--spacing-sm);
    padding: 14px;
    border-radius: var(--radius-none);
    font-size: 13px;
    display: none;
}

.upload-result.success {
    display: block;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-left: 4px solid var(--success);
    color: #2E7D32;
}

.upload-result.error {
    display: block;
    background: rgba(254, 92, 91, 0.1);
    border: 1px solid rgba(254, 92, 91, 0.3);
    border-left: 4px solid var(--coral);
    color: #C62828;
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-xl) 0 var(--spacing-md);
    gap: var(--spacing-md);
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.section-divider span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Single card grid */
.upload-grid.single {
    grid-template-columns: 1fr;
    max-width: 500px;
}

/* Optional Card Styling */
.upload-card.optional {
    border-style: dashed;
    background: var(--bg-secondary);
}

.upload-card.optional .upload-header-icon {
    stroke: var(--medium-gray);
}

.upload-card.optional h3 {
    color: var(--medium-gray);
}

/* Small Stats Grid */
.stats-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.stats-grid.small .stat-card {
    padding: var(--spacing-sm);
}

.stats-grid.small .stat-icon {
    width: 40px;
    height: 40px;
}

.stats-grid.small .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stats-grid.small .stat-value {
    font-size: 24px;
}

.stats-grid.small .stat-label {
    font-size: 12px;
}

/* Collapsible Section */
.collapsible-section {
    margin-top: var(--spacing-lg);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
}

.collapsible-section summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.collapsible-section summary:hover {
    background: var(--light-gray);
}

.collapsible-section[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section .section-icon {
    width: 18px;
    height: 18px;
    stroke: var(--medium-gray);
    stroke-width: 2px;
}

.collapsible-section .chevron-icon {
    width: 16px;
    height: 16px;
    stroke: var(--medium-gray);
    stroke-width: 2px;
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.collapsible-section[open] .chevron-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: var(--spacing-md);
}

/* ============================================
   BUTTONS - Sharp corners per brand guide
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--radius-none);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

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

/* Primary Button - Yellow (CTA) */
.btn-primary {
    background: var(--yellow);
    color: var(--navy);
}

.btn-primary:hover:not(:disabled) {
    background: var(--yellow-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--navy);
    color: var(--white);
}

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

.btn-success:hover:not(:disabled) {
    filter: brightness(1.1);
}

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

.btn-danger:hover:not(:disabled) {
    filter: brightness(1.1);
}

/* ============================================
   ACTION BAR
   ============================================ */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    box-shadow: var(--shadow-sm);
}

.action-bar-left, .action-bar-right {
    display: flex;
    gap: 12px;
}

/* ============================================
   FILTERS BAR
   ============================================ */
.filters-bar {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.search-input, .filter-select {
    padding: 12px 16px;
    font-size: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
}

.search-input {
    flex: 1;
    max-width: 400px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(12, 26, 51, 0.1);
}

/* ============================================
   DATA TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.data-table tr:hover td {
    background: rgba(12, 26, 51, 0.02);
}

.data-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.data-table code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--navy);
}

.data-table .empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* ============================================
   SETTINGS GRID
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.setting-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--yellow); }
.status-dot.danger { background: var(--coral); }

.setting-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 26, 51, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-none);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--navy);
    color: var(--white);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

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

.modal-body {
    padding: var(--spacing-md);
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
}

.toast {
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
    border-left: 4px solid var(--navy);
}

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

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--coral); }
.toast.warning { border-left-color: var(--yellow); }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(12, 26, 51, 0.1);
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--yellow);
    cursor: pointer;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-none);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { 
    background: rgba(76, 175, 80, 0.15); 
    color: #2E7D32; 
}
.badge-warning { 
    background: rgba(250, 207, 44, 0.25); 
    color: #8B6914; 
}
.badge-danger { 
    background: rgba(254, 92, 91, 0.15); 
    color: #C62828; 
}
.badge-info { 
    background: rgba(12, 26, 51, 0.1); 
    color: var(--navy); 
}

/* Price Display */
.price-up { color: var(--coral); font-weight: 700; }
.price-down { color: var(--success); font-weight: 700; }
.price-neutral { color: var(--text-secondary); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .main-content {
        padding: var(--spacing-md);
    }

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

@media (max-width: 900px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header, .nav-text, .health-text, .language-selector-wrapper {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 16px;
    }

    .nav-badge {
        position: absolute;
        right: 8px;
        top: 8px;
    }

    .main-content {
        margin-left: 70px;
    }
}

/* ============================================
   SLANTED ACCENT (78° per brand guide)
   ============================================ */
.slant-accent {
    position: relative;
    overflow: hidden;
}

.slant-accent::before {
    content: '';
    position: absolute;
    top: 0;
    right: -50px;
    width: 100px;
    height: 100%;
    background: var(--yellow);
    transform: skewX(-12deg); /* 90° - 78° = 12° */
    z-index: 0;
}

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */
.dashboard-section {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    margin-bottom: var(--spacing-md);
}

.section-title svg {
    width: 20px;
    height: 20px;
    stroke: var(--navy);
    stroke-width: 2px;
}

/* Card header with icon */
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 svg {
    width: 18px;
    height: 18px;
    stroke: var(--navy);
    stroke-width: 2px;
}

/* Two column dashboard grid */
.dashboard-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 1024px) {
    .dashboard-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FRESHNESS CARDS
   ============================================ */
.freshness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm);
}

.freshness-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-none);
    box-shadow: var(--shadow-sm);
}

.freshness-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.freshness-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--navy);
    stroke-width: 2px;
}

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

.freshness-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.freshness-value {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.freshness-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.freshness-status.success { background: var(--success); }
.freshness-status.warning { background: var(--yellow); }
.freshness-status.pending { background: var(--medium-gray); }
.freshness-status.danger { background: var(--coral); }

/* ============================================
   ACTION LIST (Dashboard)
   ============================================ */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-none);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.action-item:hover:not(.empty) {
    background: var(--light-gray);
}

.action-item.empty {
    border-left-color: var(--success);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.action-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.action-icon.warning {
    background: rgba(250, 207, 44, 0.2);
}

.action-icon.warning svg {
    stroke: #997D00;
}

.action-icon.danger {
    background: rgba(254, 92, 91, 0.15);
}

.action-icon.danger svg {
    stroke: var(--coral);
}

.action-icon.success {
    background: rgba(76, 175, 80, 0.15);
}

.action-icon.success svg {
    stroke: var(--success);
}

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

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

.action-count, .action-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--medium-gray);
    transition: all var(--transition-fast);
}

.action-link:hover {
    color: var(--navy);
}

.action-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   DATA QUALITY SECTION
   ============================================ */
.quality-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quality-item {
    display: grid;
    grid-template-columns: 1fr 120px 50px;
    align-items: center;
    gap: var(--spacing-sm);
}

.quality-label {
    font-size: 13px;
    color: var(--text-primary);
}

.quality-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    background: var(--yellow);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.quality-fill.success {
    background: var(--success);
}

.quality-fill.warning {
    background: var(--coral);
}

.quality-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.quality-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.quality-score-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.quality-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'JetBrains Mono', monospace;
}

/* Activity icon colors */
.activity-icon.success {
    stroke: var(--success);
}

.activity-icon.warning {
    stroke: var(--yellow);
}

.activity-icon.danger {
    stroke: var(--coral);
}

/* ============================================
   SETTINGS SECTIONS
   ============================================ */
.settings-section {
    margin-bottom: var(--spacing-xl);
}

.settings-section .section-title {
    margin-bottom: var(--spacing-md);
}

/* Setting input with suffix */
.setting-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.setting-input {
    width: 100px;
    text-align: right;
}

.input-suffix {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Small button */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Toggle switch */
.setting-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--spacing-sm);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-gray);
    transition: var(--transition-fast);
    border-radius: 26px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background-color: var(--success);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(12, 26, 51, 0.1);
}

/* ============================================
   NO DATA STATE
   ============================================ */
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    text-align: center;
}

.no-data svg {
    width: 48px;
    height: 48px;
    stroke: var(--medium-gray);
    margin-bottom: var(--spacing-sm);
}

.no-data-text {
    font-size: 14px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    padding: var(--spacing-md);
}

.login-card {
    background: var(--white);
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-logo {
    width: 200px;
    margin-bottom: var(--spacing-md);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--navy);
}

.login-form .form-group {
    margin-bottom: var(--spacing-md);
}

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

.login-form .form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    background: var(--white);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--navy);
}

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

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.login-error {
    background: rgba(254, 92, 91, 0.1);
    border: 1px solid var(--coral);
    color: var(--coral);
    padding: 12px 16px;
    margin-bottom: var(--spacing-md);
    font-size: 14px;
}

.login-footer {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.login-footer .language-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* ============================================
   USER INFO (Sidebar Footer)
   ============================================ */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: var(--spacing-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--yellow);
    color: var(--navy);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-on-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Admin-only nav items */
.nav-item.admin-only {
    display: none;
}

.nav-item.admin-only.visible {
    display: flex;
}

/* ============================================
   USER MANAGEMENT PAGE
   ============================================ */
.user-modal-form .form-group {
    margin-bottom: var(--spacing-md);
}

.user-modal-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.user-modal-form .form-input {
    width: 100%;
}

.user-modal-form .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-modal-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.user-modal-form .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
}

/* Badge styles for users table */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
}

.badge-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(250, 207, 44, 0.2);
    color: #B8960A;
}

.badge-danger {
    background: rgba(254, 92, 91, 0.1);
    color: var(--coral);
}

.badge-gray {
    background: var(--light-gray);
    color: var(--medium-gray);
}

/* Action buttons in table */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions .btn-icon {
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.table-actions .btn-icon:hover {
    background: var(--light-gray);
}
