:root {
    --primary: #0066A1;
    --primary-dark: #004d7a;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --sidebar-width: 260px;
    --header-height: 60px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-body {
    background: linear-gradient(135deg, #0066A1 0%, #004d7a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin: 0 auto 15px;
}

.login-header h1 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--secondary);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,161,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-info { background: var(--info); color: white; }

.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.alert {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.password-hint code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    font-size: 14px;
    margin: 0;
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.badge-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

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

.user-info {
    margin-bottom: 12px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
}

.logout-btn:hover { color: white; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
}

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

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

.session-timer {
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.session-timer i {
    color: var(--primary);
    margin-right: 6px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-icon.blue { background: linear-gradient(135deg, #0066A1, #0088cc); }
.stat-icon.red { background: linear-gradient(135deg, #dc3545, #ff6b6b); }
.stat-icon.green { background: linear-gradient(135deg, #28a745, #34ce57); }
.stat-icon.purple { background: linear-gradient(135deg, #6f42c1, #8e6cd2); }
.stat-icon.orange { background: linear-gradient(135deg, #fd7e14, #ffa94d); }
.stat-icon.teal { background: linear-gradient(135deg, #20c997, #3dd9a8); }

.stat-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: #888;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.quick-actions h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
}

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

.action-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
    border: 2px solid transparent;
}

.action-card:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
}

.action-card i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.action-card span {
    font-size: 14px;
    font-weight: 500;
}

/* Forms */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-section h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: var(--primary);
}

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

.form-row .form-group.full {
    grid-column: 1 / -1;
}

.form-group.small input {
    max-width: 80px;
}

.grand-total {
    text-align: right;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 18px;
}

.form-actions {
    text-align: right;
    padding-top: 10px;
}

.resource-row {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 14px;
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #fafbfc;
}

.positive { color: #28a745; font-weight: 600; }
.negative { color: #dc3545; font-weight: 600; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-primary { background: #cce5ff; color: #004085; }

/* Approval Cards */
.approval-section {
    margin-bottom: 40px;
}

.approval-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
}

.approval-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.approval-cost {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.mini-table {
    width: 100%;
    font-size: 13px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.mini-table th,
.mini-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.mini-table th {
    background: #e9ecef;
    font-weight: 600;
}

.approval-form {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.approval-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.comment-text {
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 4px;
}

/* Analysis */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.analysis-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.analysis-card.full {
    grid-column: 1 / -1;
    margin-bottom: 24px;
}

.analysis-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--dark);
}

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

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-item.highlight {
    background: linear-gradient(135deg, #0066A1, #004d7a);
    color: white;
}

.metric-label {
    font-size: 14px;
    color: #666;
}

.metric-item.highlight .metric-label {
    color: rgba(255,255,255,0.9);
}

.metric-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--dark);
}

.metric-item.highlight .metric-value {
    color: white;
}

.ranking-table tr.rank-1 {
    background: linear-gradient(90deg, rgba(255,215,0,0.1), transparent);
}
.ranking-table tr.rank-2 {
    background: linear-gradient(90deg, rgba(192,192,192,0.1), transparent);
}
.ranking-table tr.rank-3 {
    background: linear-gradient(90deg, rgba(205,127,50,0.1), transparent);
}

.rank-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Detail Page */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.detail-card.full {
    grid-column: 1 / -1;
    margin-bottom: 24px;
}

.detail-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--dark);
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-row label {
    font-weight: 500;
    color: #666;
    min-width: 140px;
}

.detail-row.large {
    font-size: 18px;
    padding: 16px 0;
}

.detail-row.large label {
    font-size: 16px;
}

/* Timeline */
.approval-timeline {
    position: relative;
    padding-left: 30px;
}

.approval-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 20px;
}

.timeline-badge {
    position: absolute;
    left: -30px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.timeline-item.approved .timeline-badge {
    background: var(--success);
}

.timeline-item.rejected .timeline-badge {
    background: var(--danger);
}

.timeline-content {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
}

.timeline-comment {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    color: #666;
    font-style: italic;
}

/* Filters */
.filters {
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-card h3 {
    margin-bottom: 20px;
    font-size: 16px;
}

.request-summary-bar {
    background: linear-gradient(135deg, #0066A1, #004d7a);
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 15px;
}

.request-summary-bar .positive { color: #90EE90; }
.request-summary-bar .negative { color: #ffcccb; }

.text-muted { color: #888; }
.text-center { text-align: center; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .analysis-grid,
    .detail-grid,
    .two-column { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
