/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
body { background: #f0f2f5; padding: 10px; min-height: 100vh; }
a { text-decoration: none; }

/* ===== LOGIN PAGE ===== */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a237e, #0d47a1); padding: 20px; }
.login-container { width: 100%; max-width: 400px; }
.login-card { background: white; border-radius: 16px; padding: 40px 30px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.login-card h1 { text-align: center; color: #1a237e; font-size: 28px; margin-bottom: 5px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; color: #333; margin-bottom: 5px; font-size: 14px; }
.form-group input { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; transition: border 0.2s; }
.form-group input:focus { border-color: #1a237e; outline: none; }
#loginBtn { width: 100%; padding: 14px; background: #1a237e; color: white; border: none; border-radius: 8px; font-size: 18px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
#loginBtn:hover { background: #283593; }
#loginBtn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== HEADER ===== */
.main-header { background: #1a237e; color: white; padding: 15px 20px; border-radius: 12px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header-left { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.main-header h1 { font-size: 22px; font-weight: 700; }
.badge { background: #ffb300; color: #1a237e; padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 12px; }
.header-right { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
#userName { font-weight: 500; font-size: 14px; }
.btn-logout { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); padding: 6px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: 0.2s; }
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 1400px; margin: 0 auto; }
@media (min-width: 900px) { .dashboard-grid { grid-template-columns: 1fr 1.5fr; } }

/* ===== CARDS ===== */
.card { background: white; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card h3 { color: #1a237e; font-size: 17px; margin-bottom: 12px; border-bottom: 2px solid #e8eaf6; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

/* ===== FORMS ===== */
select, input, textarea { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; background: #fafafa; transition: 0.2s; }
select:focus, input:focus, textarea:focus { border-color: #1a237e; outline: none; background: white; }
textarea { resize: vertical; min-height: 50px; }
.row-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-primary { background: #1a237e; color: white; border: none; padding: 12px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 15px; width: 100%; transition: 0.2s; }
.btn-primary:hover { background: #283593; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #e8eaf6; color: #1a237e; font-weight: 600; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.status-Open { background: #e3f2fd; color: #0d47a1; }
.status-In-Progress { background: #fff3e0; color: #e65100; }
.status-Pending { background: #fce4ec; color: #b71c1c; }
.status-Closed { background: #e8f5e9; color: #1b5e20; }

/* ===== ACTION BUTTONS ===== */
.action-btn { padding: 4px 10px; border: none; border-radius: 12px; font-size: 11px; font-weight: 600; cursor: pointer; margin: 2px; }
.btn-progress { background: #fff3e0; color: #e65100; }
.btn-pending { background: #fce4ec; color: #b71c1c; }
.btn-close { background: #e8f5e9; color: #1b5e20; }
.btn-invoice { background: #f3e5f5; color: #6a1b9a; }

/* ===== MODAL ===== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; padding: 20px; z-index: 1000; }
.modal-content { background: white; border-radius: 16px; padding: 25px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; }
.close-modal { float: right; font-size: 28px; cursor: pointer; color: #999; }
.close-modal:hover { color: #333; }
#invoiceContent p { margin: 8px 0; font-size: 14px; }

/* ===== COLLAPSIBLE (Mobile) ===== */
.card-header { cursor: pointer; user-select: none; }
.arrow { font-size: 12px; transition: transform 0.2s; }
.card-header.collapsed .arrow { transform: rotate(-90deg); }
.card-body { transition: max-height 0.3s ease; overflow: hidden; }
.card-body.hidden { max-height: 0 !important; padding: 0 !important; }

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 600px) {
    body { padding: 8px; }
    .main-header { padding: 12px 15px; flex-direction: column; text-align: center; }
    .header-left { justify-content: center; }
    .main-header h1 { font-size: 18px; }
    .card { padding: 14px; }
    .row-inputs { grid-template-columns: 1fr; }
    th, td { padding: 6px 4px; font-size: 12px; }
    .action-btn { font-size: 10px; padding: 3px 8px; }
    .modal-content { padding: 18px; }
}

/* ===== LOADING SPINNER ===== */
.loading { opacity: 0.5; pointer-events: none; }