/* ===================================================================
   BlogOps v1.0 — Core UI Stylesheet
   Modern Korean Business Management System
   =================================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-50: #eff6ff;

    /* Semantic colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --pink: #ec4899;
    --pink-light: #fce7f3;
    --orange: #f97316;
    --orange-light: #ffedd5;

    /* Layout */
    --sidebar-width: 250px;
    --topbar-height: 60px;

    /* Gray scale — matches marketinglab */
    --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;

    /* Radii — tighter like marketinglab */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows — same as marketinglab */
    --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

    /* Typography */
    --font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-100);
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}


/* =====================================================================
   APP LAYOUT
   ===================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}


/* =====================================================================
   SIDEBAR
   ===================================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f2440 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #60a5fa;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: #fff;
}

.sidebar-logo-text span {
    font-size: 10.5px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Workspace Switcher */
.ws-switcher {
    display: flex;
    gap: 4px;
    padding: 6px 12px 8px;
    flex-wrap: wrap;
}
.ws-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.ws-item:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.08);
}
.ws-item.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}
.ws-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.ws-item.active .ws-dot {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16,185,129,0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.6);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.25);
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #60a5fa;
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-item-text {
    flex: 1;
}

.nav-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    text-align: center;
}


/* =====================================================================
   MAIN CONTENT
   ===================================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* =====================================================================
   TOPBAR
   ===================================================================== */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

.topbar-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--gray-500);
    background: transparent;
    border: none;
}

.topbar-bell:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.topbar-bell svg {
    width: 20px;
    height: 20px;
}

.topbar-bell .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
}

.topbar-user:hover {
    background: var(--gray-100);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}


/* =====================================================================
   CONTENT AREA
   ===================================================================== */
.content-area {
    padding: 24px 28px;
    flex: 1;
}


/* =====================================================================
   BANNER (Welcome / Hero)
   ===================================================================== */
.banner {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.banner::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: 10%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.banner h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

.banner p {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 400;
    position: relative;
    z-index: 1;
}


/* =====================================================================
   STATS GRID
   ===================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.amber {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.purple {
    background: var(--purple-light);
    color: var(--purple);
}

.stat-icon.pink {
    background: var(--pink-light);
    color: var(--pink);
}

.stat-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-icon.orange {
    background: var(--orange-light);
    color: var(--orange);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 3px;
}


/* =====================================================================
   CARDS
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: var(--gray-300);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.2px;
}

.card-subtitle {
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 400;
    margin-top: 2px;
}

.card-body {
    padding: 20px 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}


/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--gray-50);
    padding: 11px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 1px solid var(--gray-200);
}

tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr.clickable {
    cursor: pointer;
}

table .text-center {
    text-align: center;
}

table .text-right {
    text-align: right;
}

table .text-left {
    text-align: left;
}


/* =====================================================================
   STATUS BADGES
   ===================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-quote_pending {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-light);
}
.status-quote_pending::before {
    background: #f59e0b;
}

.status-received {
    background: var(--sunk);
    color: var(--text-2);
}
.status-received::before {
    background: #94a3b8;
}

.status-working {
    background: var(--primary-light);
    color: var(--primary);
}
.status-working::before {
    background: var(--primary);
}

.status-done {
    background: var(--success-light);
    color: var(--success);
}
.status-done::before {
    background: var(--success);
}

.status-delivered {
    background: var(--purple-light);
    color: var(--violet);
}
.status-delivered::before {
    background: var(--purple);
}

.status-settled {
    background: var(--pink-light);
    color: #db2777;
}
.status-settled::before {
    background: var(--pink);
}


/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-ink);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--on-ink);
}

.btn-secondary {
    background: var(--surface);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-danger {
    background: var(--danger);
    color: var(--on-ink);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #dc2626;
    border-color: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: var(--on-ink);
    border-color: var(--success);
}
.btn-success:hover {
    background: #059669;
    border-color: var(--success);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
    padding: 9px 14px;
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
    padding: 5px;
}

.btn-group {
    display: flex;
    gap: 8px;
}


/* =====================================================================
   FORMS
   ===================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--surface);
    transition: all var(--transition);
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 2px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 2px;
}


/* =====================================================================
   MODAL
   ===================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--transition);
    border: none;
    background: transparent;
    font-size: 18px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-lg .modal {
    max-width: 740px;
}

.modal-sm .modal {
    max-width: 420px;
}


/* =====================================================================
   FILTER BAR
   ===================================================================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-bottom: 1px solid var(--gray-100);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 8px 13px 8px 38px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-700);
    background: var(--surface);
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.filter-select {
    padding: 8px 36px 8px 13px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-700);
    background: var(--surface);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


/* =====================================================================
   SUB TABS
   ===================================================================== */
.sub-tabs {
    display: flex;
    gap: 4px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sub-tab {
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    border: none;
    background: transparent;
    font-family: inherit;
}

.sub-tab:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.sub-tab.active {
    background: var(--primary);
    color: var(--on-ink);
    font-weight: 600;
}


/* =====================================================================
   PAGINATION
   ===================================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0 8px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.pagination a:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.pagination a.active,
.pagination span.active {
    background: var(--primary);
    color: var(--on-ink);
    font-weight: 700;
    border-color: var(--primary);
}


/* =====================================================================
   TOAST
   ===================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gray-800);
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    animation: toast-in 0.35s ease forwards;
    border-left: 4px solid var(--gray-400);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.success::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.warning::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.info {
    border-left-color: var(--primary);
}

.toast.info::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.fade-out {
    animation: toast-out 0.35s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}


/* =====================================================================
   EMPTY STATE
   ===================================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-400);
    font-weight: 500;
}

.empty-state .btn {
    margin-top: 16px;
}


/* =====================================================================
   AMOUNT
   ===================================================================== */
.amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.amount.income {
    color: var(--primary);
}

.amount.expense {
    color: var(--orange);
}

.amount.profit {
    color: var(--success);
}


/* =====================================================================
   BLOGGER TAG
   ===================================================================== */
.blogger-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}


/* =====================================================================
   BADGE
   ===================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: var(--on-ink);
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 20px;
    line-height: 1;
}

.badge-primary {
    background: var(--primary);
}

.badge-success {
    background: var(--success);
}

.badge-warning {
    background: var(--warning);
    color: var(--gray-900);
}


/* =====================================================================
   ACTION MENU / DROPDOWN
   ===================================================================== */
.action-menu {
    position: relative;
    display: inline-flex;
}

.action-menu .btn-icon {
    color: var(--gray-400);
}

.action-menu .btn-icon:hover {
    color: var(--gray-600);
    background: var(--gray-100);
}

.action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    display: none;
    overflow: hidden;
}

.action-dropdown.show {
    display: block;
    animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.action-dropdown a,
.action-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.action-dropdown a:hover,
.action-dropdown button:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.action-dropdown a.text-danger,
.action-dropdown button.text-danger {
    color: var(--danger);
}

.action-dropdown a.text-danger:hover,
.action-dropdown button.text-danger:hover {
    background: var(--danger-light);
}

.action-dropdown svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.action-dropdown .divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}


/* =====================================================================
   MOBILE MENU
   ===================================================================== */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-600);
    transition: all var(--transition);
    border: none;
    background: transparent;
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}


/* =====================================================================
   REPORT CARD
   ===================================================================== */
.report-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 14px;
    transition: all var(--transition);
}

.report-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow);
}

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.report-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.report-card-date {
    font-size: 12px;
    color: var(--gray-400);
}

.report-card-body {
    font-size: 13.5px;
    color: var(--gray-600);
    line-height: 1.7;
}

.report-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.report-status.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.report-status.approved {
    background: var(--success-light);
    color: var(--success);
}


/* =====================================================================
   CHART BARS
   ===================================================================== */
.chart-bar-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chart-bar-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 80px;
    white-space: nowrap;
}

.chart-bars {
    flex: 1;
    display: flex;
    gap: 3px;
    align-items: center;
}

.chart-bar {
    height: 24px;
    border-radius: 4px;
    min-width: 2px;
    transition: all 0.4s ease;
    position: relative;
}

.chart-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.15);
}

.chart-bar-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-left: 8px;
    white-space: nowrap;
}


/* =====================================================================
   ALERTS
   ===================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-info {
    background: var(--primary-50);
    color: var(--primary-dark);
    border-color: var(--info-light);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning-light);
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border-color: var(--success-light);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-color: var(--danger-light);
}


/* =====================================================================
   DETAIL ROWS (key-value pairs)
   ===================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-800);
}


/* =====================================================================
   TIMELINE
   ===================================================================== */
.timeline {
    padding: 0;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-content .time {
    font-size: 12px;
    color: var(--gray-400);
}

.timeline-content .desc {
    font-size: 14px;
    color: var(--gray-700);
}


/* =====================================================================
   TWO COLUMN LAYOUT
   ===================================================================== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}


/* =====================================================================
   DEADLINE ALERT
   ===================================================================== */
.deadline-alert {
    color: var(--danger);
    font-weight: 600;
    font-size: 12px;
}


/* =====================================================================
   UTILITY CLASSES
   ===================================================================== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-purple { color: var(--purple) !important; }
.text-pink { color: var(--pink) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-sm { font-size: 12.5px !important; }
.text-xs { font-size: 11.5px !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }

.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }
.gap-half { gap: 4px !important; }
.flex-1 { flex: 1 !important; }
.flex-wrap { flex-wrap: wrap !important; }

.w-full { width: 100% !important; }
.overflow-hidden { overflow: hidden !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cursor-pointer { cursor: pointer !important; }

.border-t { border-top: 1px solid var(--gray-200) !important; }
.border-b { border-bottom: 1px solid var(--gray-200) !important; }


/* =====================================================================
   LOGIN PAGE
   ===================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2440 40%, #162d50 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    font-weight: 800;
    color: #60a5fa;
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin-top: 6px;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.3px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: #fff;
    transition: all var(--transition);
}

.login-field input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.login-field input::placeholder {
    color: rgba(255,255,255,0.3);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 6px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    font-size: 13px;
    color: #fca5a5;
}

.login-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Notification dropdown */
.notif-dropdown .notif-item:hover {
    background: var(--gray-50) !important;
}

@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay.active {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-date {
        display: none;
    }

    .content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
    }

    .stat-value {
        font-size: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .banner {
        padding: 20px;
        border-radius: var(--radius);
    }

    .banner h2 {
        font-size: 17px;
    }

    .card-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-bar {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 0;
        max-width: none;
        flex: 1 1 100%;
    }

    .table-wrapper {
        margin: 0 -16px;
    }

    thead th,
    tbody td {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .modal {
        max-width: 100%;
        margin: 0 10px;
        max-height: 95vh;
    }

    .modal-body {
        padding: 18px;
    }

    .toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .sub-tabs {
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        align-items: center;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }
}

/* =====================================================================
   MOBILE OPTIMIZATION — 전체 페이지 공통
   ===================================================================== */
@media (max-width: 768px) {
    /* 테이블 가로 스크롤 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrapper table {
        min-width: 600px;
    }

    /* 페이지 제목 영역 */
    .d-flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    /* h1 타이틀 */
    h1 {
        font-size: 20px !important;
    }

    /* 버튼 그룹 */
    .d-flex.gap-1 {
        flex-wrap: wrap;
    }

    /* 탭 버튼 */
    .sub-tabs a, .sub-tabs button {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* 필터 폼 */
    .card form[method="GET"] {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .card form[method="GET"] input,
    .card form[method="GET"] select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    .card form[method="GET"] .btn {
        width: 100%;
    }

    /* 두 컬럼 레이아웃 → 한 컬럼 */
    .two-col {
        grid-template-columns: 1fr !important;
    }

    /* 타임라인 */
    .timeline-item {
        padding-left: 20px;
    }

    /* 액션 바 */
    .d-flex.items-center.justify-between.mb-2 {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* 채팅/피드 입력 */
    textarea {
        font-size: 14px !important;
    }

    /* 모달 전체화면 */
    .modal-overlay .modal {
        max-width: 100% !important;
        margin: 8px !important;
        max-height: 95vh;
    }

    /* 캘린더 */
    .cal-grid {
        font-size: 11px;
    }

    /* 인라인 폼 */
    .inline-edit input {
        width: 100px !important;
    }

    /* 카드 패딩 축소 */
    .card-body {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* 테이블 최소 너비 축소 */
    .table-wrapper table {
        min-width: 500px;
    }

    thead th, tbody td {
        padding: 8px 10px;
        font-size: 11.5px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }
}


/* =====================================================================
   SCROLLBAR
   ===================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}


/* ===== Form Sections (Blogger create/edit) ===== */
.form-section { margin-bottom: 28px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: var(--gray-800);
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}
.form-section-title i, .form-section-title svg { color: var(--primary); width: 18px; height: 18px; }

/* Radio group */
.radio-group { display: flex; gap: 16px; padding-top: 4px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-group input[type="radio"] { accent-color: var(--primary); }

/* Info sections (Blogger view) */
.info-section { margin-bottom: 24px; }
.info-section:last-child { margin-bottom: 0; }
.info-section-title {
    font-size: 14px; font-weight: 700; color: var(--gray-700);
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 6px;
}
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.detail-item label { display: block; font-size: 11px; color: var(--gray-500); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.detail-item span, .detail-item a { font-size: 13px; color: var(--gray-800); }
.detail-item.full { grid-column: 1 / -1; }

/* Blogger header badges */
.blogger-header-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-settlement, .badge-contract, .badge-index {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: var(--radius-full); font-size: 11px; font-weight: 600;
}
.badge-settlement { background: var(--primary-light); color: var(--primary); }
.badge-contract { background: var(--purple-light); color: var(--purple); }

/* Index badges */
.index-badge {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: var(--radius-full); font-size: 11px; font-weight: 600;
}
.index-badge.optimal { background: var(--success-light); color: var(--success); }
.index-badge.sub-optimal { background: var(--primary-light); color: var(--primary); }
.index-badge.low { background: var(--danger-light); color: var(--danger); }
.index-badge.other { background: var(--gray-100); color: var(--gray-500); }

/* Page header utility */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 18px; font-weight: 700; }
.page-header p { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* Filter bar row */
.filter-bar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Star rating display */
.star-rating { color: var(--warning); font-size: 13px; letter-spacing: 1px; }
.star-rating .empty { color: var(--gray-300); }

/* Specialty tags */
.specialty-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.specialty-tag {
    display: inline-flex; padding: 2px 8px; background: var(--gray-100);
    color: var(--gray-600); border-radius: var(--radius-full); font-size: 11px;
}

/* ===== Bulk Actions ===== */
.bulk-actions {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--primary-50);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    margin-bottom: 12px;
    animation: fadeIn 0.2s ease;
}
.bulk-actions.show { display: flex; }
.bulk-actions .selected-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}
.bulk-actions .btn { font-size: 12px; }
table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== File Upload ===== */
.file-upload-area { border: 2px dashed var(--gray-200); border-radius: var(--radius-md); transition: border-color 0.2s, background 0.2s; }
.file-upload-area.drag-over { border-color: var(--primary); background: var(--primary-50); }
.file-upload-trigger { padding: 24px 20px; text-align: center; cursor: pointer; }
.file-upload-trigger:hover { background: var(--gray-50); border-radius: var(--radius-md); }
.file-list { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.file-list:empty { padding: 0; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--gray-50); border-radius: var(--radius); font-size: 13px; }
.file-icon { font-size: 18px; flex-shrink: 0; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-size { color: var(--gray-400); font-size: 11px; flex-shrink: 0; }
.file-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 12px; color: var(--gray-700); text-decoration: none; transition: background 0.15s; }
.attachment-item:hover { background: var(--primary-50); border-color: var(--primary-light); color: var(--primary); }
.attachment-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid var(--gray-200); }

/* =====================================================================
   PRINT
   ===================================================================== */
@media print {
    .sidebar,
    .topbar,
    .mobile-menu-btn,
    .mobile-overlay,
    .toast-container,
    .btn,
    .filter-bar,
    .pagination {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .card {
        border: 1px solid var(--border) !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    body {
        background: var(--surface) !important;
        color: var(--ink) !important;
    }
}
