/* -------------------------------------------------------------
 * Custom Design CSS for School Budget Approval System
 * Nachaliang Phittayakom School
 * ------------------------------------------------------------- */

/* Theme Variables */
:root {
    --primary: #1e3a8a;       /* Deep Navy Blue */
    --primary-light: #3b82f6; /* Accent Blue */
    --secondary: #d97706;     /* Golden Amber */
    --secondary-light: #f59e0b; /* Bright Amber */
    --success: #15803d;       /* Green */
    --success-light: #22c55e;
    --danger: #b91c1c;        /* Crimson Red */
    --danger-light: #ef4444;
    --warning: #b45309;       /* Orange Warning */
    --warning-light: #f97316;
    
    --bg-main: #f1f5f9;       /* Slate Light Background */
    --bg-card: #ffffff;       /* Pure White Cards */
    --border-color: #e2e8f0;  /* Card Border Slate */
    
    --text-primary: #0f172a;  /* Dark Slate text */
    --text-secondary: #475569;/* Soft Gray text */
    --text-muted: #94a3b8;    /* Muted Slate text */
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Sarabun', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* -------------------------------------------------------------
 * Simulator Bar Styling (No-Print)
 * ------------------------------------------------------------- */
.simulator-bar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 10px 20px;
    border-bottom: 2px solid var(--secondary);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sim-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.sim-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-light);
}

.sim-roles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.role-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.role-btn.active {
    background: var(--secondary);
    color: #ffffff;
    border-color: var(--secondary-light);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

/* Fiscal Year Selector in simulator */
.sim-year-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sim-year-selector label {
    font-weight: 600;
    color: #94a3b8;
}

.year-dropdown {
    background: #1e293b;
    color: #ffffff;
    border: 1px solid #475569;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.sim-db-control button {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.sim-db-control button:hover {
    background: rgba(239, 68, 68, 0.5);
    color: #ffffff;
}

/* -------------------------------------------------------------
 * Main Layout Container
 * ------------------------------------------------------------- */
.app-container {
    display: flex;
    min-height: calc(100vh - 54px);
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: #0f172a;
    color: #f8fafc;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid #1e293b;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.school-info h2 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.school-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.user-profile-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.user-avatar i {
    font-size: 32px;
    color: var(--secondary-light);
}

.user-details h3 {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
}

.user-details span {
    font-size: 11px;
    color: var(--text-muted);
}

/* Dropdowns in Sidebar */
.teacher-dropdown {
    width: 100%;
    background: #1e293b;
    color: #ffffff;
    border: 1px solid #475569;
    padding: 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    margin-top: 4px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    background-color: var(--primary);
    color: #ffffff;
}

.menu-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 11px;
    color: #475569;
    text-align: center;
}

.sidebar-footer span {
    display: block;
    margin-top: 4px;
}

/* Main Content area */
.main-content {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* System Lock Warning Banner */
.system-lock-banner {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 20px;
    border-radius: 12px;
    animation: slideDown 0.3s ease-out;
}

.lock-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.lock-banner-content i {
    font-size: 16px;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.navbar h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.budget-status-chip {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.budget-status-chip .label {
    color: var(--text-secondary);
}

.budget-status-chip .value {
    font-weight: 700;
    color: var(--primary);
}

.budget-status-chip.warning {
    border-left: 4px solid var(--secondary);
}

.budget-status-chip.warning .value {
    color: var(--secondary);
}

.budget-status-chip.success {
    border-left: 4px solid var(--success);
}

.budget-status-chip.success .value {
    color: var(--success);
}

/* -------------------------------------------------------------
 * Views Framework
 * ------------------------------------------------------------- */
.content-view {
    display: none;
}

.content-view.active-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Grid elements */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

@media (max-width: 900px) {
    .grid-2col, .grid-3col {
        grid-template-columns: 1fr;
    }
}

/* Stats Card Customizer */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue { background: #eff6ff; color: #1d4ed8; }
.bg-yellow { background: #fef9c3; color: #a16207; }
.bg-green { background: #f0fdf4; color: #15803d; }
.bg-red { background: #fef2f2; color: #b91c1c; }

.stat-info h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-info .value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
}

/* Welcome premium card */
.welcome-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.welcome-content {
    position: relative;
    z-index: 2;
    max-width: 60%;
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary-light);
}

.welcome-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.welcome-pattern {
    position: absolute;
    right: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background-image: radial-gradient(rgba(245, 158, 11, 0.15) 20%, transparent 20%);
    background-size: 20px 20px;
    mask-image: linear-gradient(to left, rgba(0,0,0,1), rgba(0,0,0,0));
}

/* -------------------------------------------------------------
 * Custom Search & Filter Inputs (Instant Search)
 * ------------------------------------------------------------- */
.filter-card {
    padding: 16px !important;
}

.search-filters-row {
    display: flex;
    gap: 16px;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.search-input-group {
    position: relative;
    flex-grow: 2;
    min-width: 280px;
}

.search-input-group input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background: #ffffff;
}

.search-input-group input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.filter-dropdown-group {
    display: flex;
    gap: 12px;
    flex-grow: 1;
    justify-content: flex-end;
}

.filter-dropdown-group select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #ffffff;
    cursor: pointer;
    font-weight: 500;
}

/* -------------------------------------------------------------
 * Custom Charts Section
 * ------------------------------------------------------------- */
.chart-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

/* -------------------------------------------------------------
 * Table & Data Grids
 * ------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-warning { color: var(--secondary); }
.text-danger { color: var(--danger); }
.bold { font-weight: 700; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-info { background-color: #eff6ff; color: #1e40af; }
.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef9c3; color: #854d0e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }

/* Roster Role borders badge (Aesthetic Tags) */
.role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
}

.role-badge.admin { border-left: 4px solid #64748b; color: #334155; }
.role-badge.teacher { border-left: 4px solid #3b82f6; color: #1d4ed8; }
.role-badge.head { border-left: 4px solid #f59e0b; color: #b45309; }
.role-badge.finance { border-left: 4px solid #10b981; color: #047857; }
.role-badge.deputy { border-left: 4px solid #8b5cf6; color: #6d28d9; }
.role-badge.director { border-left: 4px solid #ef4444; color: #b91c1c; }

/* Timeline Status Log */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-card);
}

.timeline-dot.success { background-color: var(--success-light); }
.timeline-dot.active { background-color: var(--warning-light); }

.timeline-content h5 {
    font-size: 13px;
    font-weight: 700;
}

.timeline-content p {
    font-size: 11px;
    color: var(--text-secondary);
}

.timeline-content .remark {
    font-size: 11px;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-style: italic;
}

/* -------------------------------------------------------------
 * Buttons & Controls
 * ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #172554;
    box-shadow: 0 0 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
}

.btn-green {
    background-color: var(--success);
    color: #ffffff;
}

.btn-green:hover {
    background-color: #14532d;
}

.btn-red {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-red:hover {
    background-color: #7f1d1d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* -------------------------------------------------------------
 * Admin Toggle Switch (Sliding Lock switch)
 * ------------------------------------------------------------- */
.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.control-row:last-child {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--success);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.admin-dept-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-dept-input-row label {
    font-size: 13px;
    font-weight: 600;
    min-width: 140px;
}

.admin-dept-input-row input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

/* -------------------------------------------------------------
 * Forms & Inputs
 * ------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label.required::after {
    content: " *";
    color: var(--danger);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-4 { width: 33.33%; }
.col-6 { width: 50%; }
.col-8 { width: 66.66%; }

/* -------------------------------------------------------------
 * Modals Layout
 * ------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-container {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease-out;
    overflow: hidden;
}

.modal-container.modal-lg {
    max-width: 1100px;
}

@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-section {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.section-title-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title-action h3 {
    margin-bottom: 0;
    border: none;
    padding: 0;
}

/* Item budget table form */
.item-table {
    width: 100%;
    border-collapse: collapse;
}

.item-table th {
    background: #f1f5f9;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}

.item-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.item-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

.btn-remove-row {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.budget-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
}

.budget-summary-bar .total-amount {
    font-size: 18px;
    color: var(--danger);
}

/* -------------------------------------------------------------
 * Approval Layout View
 * ------------------------------------------------------------- */
.approval-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.approval-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.border-table th, .border-table td {
    border: 1px solid var(--border-color);
}

.info-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.info-badges span {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Canvas drawing pad */
.signature-canvas-container {
    border: 2px dashed var(--text-muted);
    border-radius: 12px;
    background-color: #fafafa;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}

.signature-canvas-container canvas {
    background: #ffffff;
    cursor: crosshair;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

.btn-clear-sig {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-sig:hover {
    background: var(--danger);
    color: #ffffff;
}

.active-step-role-chip {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #fde68a;
}

.action-buttons-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-buttons-group button {
    flex-grow: 1;
}

.approval-action-panel {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    align-self: flex-start;
}

/* -------------------------------------------------------------
 * Progress tracker flow
 * ------------------------------------------------------------- */
.progress-bar-container {
    width: 100%;
    background-color: var(--border-color);
    height: 6px;
    border-radius: 3px;
    position: relative;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-light);
    width: 0%;
    border-radius: 3px;
    transition: var(--transition);
}

/* -------------------------------------------------------------
 * Print Specific Rules CSS
 * ------------------------------------------------------------- */
.print-only {
    display: none;
}

@media print {
    body, html {
        background-color: #ffffff;
        color: #000000;
        font-size: 15px;
    }
    
    .no-print, .simulator-bar, .sidebar, .navbar, .content-view, .modal-backdrop {
        display: none !important;
    }
    
    .app-container {
        display: block !important;
        min-height: 0 !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    @page {
        size: A4;
        margin: 2cm 1.5cm 2cm 2.5cm;
    }
    
    .gov-memo-container {
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    .print-signatures-section {
        page-break-before: always;
        break-before: page;
    }
}

.gov-memo-container {
    background: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 50px;
    border: 1px solid #d1d5db;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    color: #000000;
}

.memo-header-wrapper {
    position: relative;
    height: 100px;
    margin-bottom: 20px;
}

.garuda-logo {
    position: absolute;
    left: 0;
    top: 0;
}

.memo-header-wrapper h1 {
    text-align: center;
    font-size: 29px;
    font-weight: 700;
    line-height: 100px;
    margin: 0;
}

.memo-meta {
    font-size: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
}

.meta-row {
    margin-bottom: 8px;
}

.meta-row-half {
    display: flex;
    margin-bottom: 8px;
}

.meta-row-half > div {
    width: 50%;
}

.meta-label {
    font-weight: 700;
    font-size: 16px;
    display: inline-block;
    min-width: 80px;
}

.meta-value {
    font-size: 15px;
}

.memo-to {
    font-size: 16px;
    margin-bottom: 20px;
}

.memo-to span {
    font-weight: 700;
}

.to-value {
    margin-left: 10px;
}

.memo-body {
    font-size: 15px;
    line-height: 1.6;
}

.paragraph {
    text-indent: 2.5cm;
    margin-bottom: 12px;
    text-align: justify;
}

.bold {
    font-weight: 700;
}

.data-text {
    border-bottom: 1px dotted #6b7280;
    padding: 0 4px;
}

.print-item-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

.print-item-table th {
    border: 1px solid #000000;
    padding: 6px;
    background: #f3f4f6;
    font-weight: 700;
}

.print-item-table td {
    border: 1px solid #000000;
    padding: 6px;
}

.print-signatures-section {
    margin-top: 30px;
}

.sig-block-right {
    float: right;
    width: 250px;
    text-align: center;
    margin-bottom: 20px;
}

.sig-block-left {
    width: 230px;
    text-align: center;
    margin-top: 10px;
}

.sig-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.sig-line {
    border-bottom: 1px solid #000000;
    height: 45px;
    width: 100%;
    margin-bottom: 8px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sig-img {
    max-height: 45px;
    max-width: 180px;
    object-fit: contain;
}

.sig-name, .sig-position {
    font-size: 13px;
    line-height: 1.4;
}

.clear {
    clear: both;
}

.sig-approval-flow-box {
    border: 1px solid #000000;
    display: flex;
    margin-top: 15px;
}

.sig-half-col {
    width: 50%;
    padding: 12px;
}

.border-left {
    border-left: 1px solid #000000;
}

.print-remark {
    font-size: 13px;
    font-style: italic;
    background: #f9fafb;
    padding: 6px;
    border-radius: 4px;
    margin: 8px 0;
    min-height: 30px;
}

.checkbox-container-print {
    margin: 10px 0;
}

.print-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

.print-check {
    width: 18px;
    height: 18px;
    border: 1px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.print-footer {
    border-top: 1px solid #d1d5db;
    margin-top: 30px;
    padding-top: 8px;
    text-align: center;
    font-size: 11px;
    color: #6b7280;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-5 { margin-top: 5px; }
.mb-10 { margin-bottom: 10px; }

/* Print Page Breaks & Specific Redesign Styles */
.page-break {
    page-break-after: always;
    break-after: page;
}

@media print {
    /* Prevent default page breaks on signature section */
    .print-signatures-section {
        page-break-before: auto !important;
        break-before: auto !important;
    }
    
    /* Ensure table rows do not break awkwardly */
    .print-item-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Adjust margins for printing to fit A4 */
    @page {
        size: A4;
        margin: 1.5cm 1.5cm 1.5cm 2cm;
    }
}

/* Budget Source Print Layout Grid */
.budget-source-print-grid {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
    padding-left: 2.5cm;
}

.print-source-row {
    display: flex;
    width: 100%;
}

.print-source-col {
    width: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.print-check-box {
    width: 14px;
    height: 14px;
    border: 1px solid #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.dot-underline {
    border-bottom: 1px dotted #000000;
    padding-bottom: 2px;
}

.project-info-header-print {
    font-size: 13px;
    margin-bottom: 10px;
    border-bottom: 1px solid #000000;
    padding-bottom: 5px;
}

.committee-print-section {
    font-size: 13px;
    border: 1px solid #000000;
    padding: 8px 12px;
    margin-top: 10px;
}

.committee-list-print li {
    line-height: 1.6;
}

.full-width-box {
    width: 100%;
}

.sig-full-col {
    width: 100%;
    padding: 12px;
}

.text-center-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px auto 0 auto;
}

/* --- PRINT LAYOUT V3 CUSTOM ADDITIONS --- */
.print-signatures-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
}

.sig-col-left, .sig-col-right {
    width: 45%;
    text-align: center;
}

.sig-line-embed {
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sig-img {
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
}

.planner-check-box-print {
    margin-top: 15px;
}

.planner-options-row {
    display: flex;
    gap: 30px;
    margin-top: 5px;
    padding-left: 2.5cm;
}

.budget-grid-table-print {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: 11px;
}

.budget-grid-table-print th, .budget-grid-table-print td {
    border: 1px solid #000000;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}

.budget-grid-table-print td.text-right {
    text-align: right;
    padding-right: 6px;
}

.print-bottom-layout {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
    font-size: 12px;
    border: 1px solid #000000;
}

.bottom-col-left {
    width: 50%;
    padding: 10px;
    border-right: 1px solid #000000;
}

.bottom-col-right {
    width: 50%;
    padding: 10px;
}

.bottom-remark-box {
    margin-bottom: 5px;
    font-size: 12px;
}

.bottom-section-title {
    font-weight: bold;
}

.bottom-sig-block {
    text-align: center;
    margin-top: 10px;
}

.bottom-check-row {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.clear {
    clear: both;
}

.print-page-1, .print-page-2 {
    page-break-inside: avoid;
    break-inside: avoid;
}
