/* ===== CSS Variables (Light Theme) ===== */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #dc2626;
    --accent: #f59e0b;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --info: #0284c7;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --first-payment: #2563eb;
    --first-non-payment: #dc2626;
    
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #1e293b);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    transform: scaleY(0.9);
    transform-origin: top center;
}

/* ===== Left Sidebar (Tree Menu) ===== */
.sidebar-left {
    width: 280px;
    background: var(--bg-card, #ffffff);
    border-right: 1px solid var(--border-color, #e2e8f0);
    padding: 0.5rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-left.hidden {
    transform: translateX(-100%);
}

.sidebar-left-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.4rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-link {
    text-decoration: none;
    text-align: center;
    display: block;
}

.sidebar-logo-img {
    max-width: 160px;
    height: auto;
    margin-bottom: 0.2rem;
}

.sidebar-system-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.sidebar-system-name .sidebar-title-logo {
    height: 2.2rem;
    width: auto;
    flex-shrink: 0;
}

.sidebar-user-info {
    margin-top: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: transparent;
    border: 1px solid #90caf9;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user-info .user-info-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1565c0;
    white-space: nowrap;
    line-height: 1.3;
}

.sidebar-left-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.sidebar-toggle-btn {
    position: fixed;
    right: 1rem;
    bottom: 1.5rem;
    z-index: 101;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.sidebar-toggle-btn.sidebar-hidden {
    right: auto;
    left: 1rem;
}

.sidebar-toggle-btn:hover {
    background: #e2e8f0;
}

/* 시스템 규칙 조회 링크 */
.system-link {
    display: block;
    padding: 10px 15px;
    margin: 8px 10px;
    background: #e3f2fd;
    color: #1976d2;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid #bbdefb;
}

.system-link:hover {
    background: #bbdefb;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.2);
}

/* 시스템 규칙 조회 서브메뉴 */
.system-menu-wrapper {
    margin: 8px 10px;
}

.system-submenu {
    background: #f5f5f5;
    border-radius: 6px;
    margin-top: 5px;
    overflow: hidden;
}

.system-submenu-item {
    display: block;
    padding: 8px 15px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.system-submenu-item:last-child {
    border-bottom: none;
}

.system-submenu-item:hover {
    background: #e3f2fd;
    color: #1976d2;
}

/* 우측 하단 코너 영역 */
.corner-buttons {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
}

.user-id-corner {
    background: rgba(200, 200, 200, 0.8);
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-id-corner::before {
    content: '👤 ';
}

.system-info-btn {
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    text-decoration: none;
    transition: all 0.2s ease;
}

.system-info-btn:hover {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    box-shadow: 0 4px 10px rgba(25, 118, 210, 0.4);
    transform: translateY(-1px);
}

/* Tree Menu */
/* 사이드바 상단 버튼 */
.sidebar-top-buttons {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    list-style: none;
}

.sidebar-top-buttons .btn-home,
.sidebar-top-buttons .btn-logout {
    flex: 1;
    padding: 4px 8px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-top-buttons .btn-home {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.sidebar-top-buttons .btn-home:hover {
    background: #1976d2;
    color: white;
}

.sidebar-top-buttons .btn-logout {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.sidebar-top-buttons .btn-logout:hover {
    background: #c62828;
    color: white;
}

.tree-menu {
    list-style: none;
}

.tree-menu-section {
    margin-bottom: 0.15rem;
}

.tree-menu-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: default;
    border-radius: var(--radius-sm);
    background: #f0f4f8;
    margin-top: 0.1rem;
}

.tree-menu-header .icon {
    font-size: 0.95rem;
}

.tree-menu-header .arrow {
    display: none;
}

.tree-submenu {
    list-style: none;
    padding-left: 0.2rem;
    display: block !important;
    max-height: none !important;
    overflow: visible;
}

.tree-menu-section .tree-submenu,
.tree-menu-section.open .tree-submenu {
    max-height: none !important;
    display: block !important;
}

.tree-submenu-item {
    margin: 0.08rem 0;
}

.tree-submenu-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem 0.2rem 1.8rem;
    color: #555;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tree-submenu-link:hover {
    background: #e3f2fd;
    color: #1565c0;
}

.tree-submenu-link.active {
    background: #bbdefb;
    color: #0d47a1;
    font-weight: 700;
    border-left: 3px solid #1976d2;
}

.tree-submenu-link .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Layout with left sidebar */
.main-content-with-sidebar {
    flex: 1;
    padding: 0.8rem 1rem;
    margin-left: 280px;
    min-height: 100vh;
    min-height: 100dvh;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    transition: margin-left 0.3s ease;
}

.main-content-with-sidebar.sidebar-hidden {
    margin-left: 0;
}

.main-content-full {
    flex: 1;
    padding: 0.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header-center {
    text-align: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.page-title-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.footer-info {
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-description {
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

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

.card-header {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 0.75rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #15803d);
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    background: #f5f5f5;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* ===== 통일된 디자인 시스템 (v2) ===== */

/* 표준 데이터 테이블 */
.std-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

.std-table th,
.std-table td {
    padding: 12px 14px;
    border: 1px solid #ddd;
    text-align: center;
}

.std-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 17px;
    color: #333;
    white-space: nowrap;
}

.std-table tbody tr:hover {
    background: #f5f5f5;
}

.std-table tbody tr.total-row {
    background: #e8f5e9;
    font-weight: 600;
}

.std-table .text-left { text-align: left; }
.std-table .text-right { text-align: right; }
.std-table .text-center { text-align: center; }

.std-table .count-cell {
    cursor: pointer;
}

.std-table .count-cell:hover {
    background: #e3f2fd;
}

.std-table .count-cell.zero {
    color: #ccc;
}

/* 표준 버튼 */
.std-btn {
    padding: 10px 25px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.std-btn:hover {
    background: #1565c0;
    box-shadow: 0 3px 8px rgba(25, 118, 210, 0.3);
}

.std-btn-sm {
    padding: 5px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.std-btn-sm:hover {
    background: #1565c0;
}

/* 표준 섹션 제목 */
.section-title-lg {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.section-title-md {
    font-size: 22px;
    font-weight: 600;
    margin: 30px 0 15px 0;
    padding-top: 20px;
    border-top: 2px solid #ddd;
    color: #555;
}

.section-title-sm {
    font-size: 21px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.section-title-sm.normal { color: #28a745; }
.section-title-sm.warning { color: #f59e0b; }
.section-title-sm.info { color: #1976d2; }

/* 표준 상태 색상 */
.text-normal { color: #28a745; }
.text-warning { color: #f59e0b; }
.text-info { color: #1976d2; }
.text-danger { color: #dc3545; }

.bg-normal { background: #d4edda; color: #155724; }
.bg-warning { background: #fff3cd; color: #856404; }
.bg-info { background: #e3f2fd; color: #1565c0; }
.bg-danger { background: #f8d7da; color: #721c24; }

/* 표준 검색 박스 */
.std-search-box {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 15px;
}

.std-search-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.std-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.std-search-item label {
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    color: #333;
}

.std-search-item select,
.std-search-item input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
}

/* 표준 카드 */
.std-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    overflow: hidden;
}

.std-card-header {
    background: #e3f2fd;
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.std-card-header.normal { background: #e8f5e9; }
.std-card-header.warning { background: #fff3e0; }

.std-card-body {
    padding: 15px 20px;
}

/* 표준 요약 정보 */
.std-summary {
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 22px;
}

/* ===== Unified Data Tables (Legacy) ===== */
.unified-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    table-layout: auto;
}

.unified-table th,
.unified-table td {
    padding: 12px 14px;
    text-align: left;
    border: 1px solid #ddd;
    font-size: 18px;
    color: #333;
}

.unified-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 17px;
    white-space: nowrap;
}

.unified-table tbody tr:hover {
    background: #f5f5f5;
}

.unified-table tbody tr.active {
    background: #e3f2fd;
}

.unified-table .text-center { text-align: center; }
.unified-table .text-right { text-align: right; }
.unified-table .text-left { text-align: left; }

.unified-table .rank-badge {
    display: inline-block;
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: #e0e0e0;
    color: #666;
}

.unified-table .rank-badge.top1 { background: #ffd700; color: #333; }
.unified-table .rank-badge.top2 { background: #c0c0c0; color: #333; }
.unified-table .rank-badge.top3 { background: #cd7f32; color: #fff; }

.unified-table .count-value {
    font-weight: 600;
    color: #1976d2;
}

.unified-table .btn-view {
    padding: 5px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.unified-table .btn-view:hover {
    background: #1565c0;
}

.unified-table .status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.unified-table .status-normal { background: #e8f5e9; color: #2e7d32; }
.unified-table .status-abnormal { background: #ffebee; color: #c62828; }

.unified-table .total-row {
    background: #e3f2fd;
    font-weight: 600;
}

.unified-table .total-row td {
    border-top: 2px solid #1976d2;
}

/* Progress Bar */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-bg {
    flex: 1;
    height: 16px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 8px;
    transition: width 0.5s ease;
}

.progress-bar-text {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    font-size: 12px;
    color: #2e7d32;
}

/* Empty Message */
.empty-msg {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: var(--success);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(234, 88, 12, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.2);
    color: var(--warning);
}

.alert-info {
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.2);
    color: var(--info);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(2, 132, 199, 0.1);
    color: var(--info);
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-backdrop.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none !important; }

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Menu Buttons Grid ===== */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    border: 1px solid transparent;
}

.menu-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.menu-btn-number {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.menu-btn-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.menu-btn-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

/* Menu Button Colors */
.menu-btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

.menu-btn-info {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
}

.menu-btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
}

.menu-btn-warning {
    background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%);
}

.menu-btn-purple {
    background: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%);
}

.menu-btn-indigo {
    background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
}

.menu-btn-teal {
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
}

.menu-btn-cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%);
}

.menu-btn-emerald {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.menu-btn-orange {
    background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%);
}

.menu-btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.menu-btn-rose {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
}

.menu-btn-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.menu-btn-slate {
    background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
}

/* ===== Global Print Styles ===== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidebar-left,
    .sidebar-toggle-btn,
    .page-header {
        display: none !important;
    }
    
    .main-content-with-sidebar {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
    }
    
    .btn,
    .print-btn {
        display: none !important;
    }
}
