/* Officials Portal Stylesheet — Desktop Design matching Admin */

:root {
    /* Brand */
    --primary-color: #f0e68c;
    --secondary-color: #d4af37;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Backgrounds */
    --bg-page: #f8f9fa;
    --bg-surface: #ffffff;
    --bg-surface2: #f8f9fa;
    --bg-input: #ffffff;

    /* Text */
    --dark-text: #333333;
    --text-muted: #666666;

    /* Borders & Shadows */
    --border-color: #dddddd;
    --border-light: #eeeeee;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

    /* Legacy aliases */
    --primary-dark: #aa8c2c;
    --primary-blue: #d4af37;
    --accent: #f0e68c;
    --gold: #d4af37;
    --text: #333;
    --text-muted: #777;
    --bg: #f4f6f9;
    --border: #e0e0e0;
    --white: #fff;
    --success-bg: #d4edda; --success-text: #155724;
    --warning-bg: #fff3cd; --warning-text: #856404;
    --danger-bg: #f8d7da;  --danger-text: #721c24;
    --info-bg: #e8f4f8;    --info-text: #0c5460;
}

[data-theme="dark"] {
    --primary-color: #d4af37;
    --secondary-color: #f0e68c;

    --bg-page: #1a1a2e;
    --bg-surface: #16213e;
    --bg-surface2: #0f3460;
    --bg-input: #1e1e3a;

    --dark-text: #e0e0e0;
    --text-muted: #9090aa;

    --border-color: #2a2a4a;
    --border-light: #2a2a4a;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-page);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Main Content wrapper with sidebar */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-page);
}

.official-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    margin-top: 0;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Page Header (matches admin page-header) ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--dark-text);
    font-weight: 700;
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,175,55,0.3); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f0f2f5; }
.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }
.btn-danger  { background: #dc3545; color: white; }
.btn-danger:hover  { background: #c82333; }
.btn-warning { background: #e6a817; color: white; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* "Set Account" / "Update Account" style in index.php */
.btn-account {
    background: var(--primary-dark);
    color: white;
    border-radius: 6px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.22s;
}
.btn-account:hover { background: var(--primary-blue); transform: translateY(-1px); }

/* ─── Cards ─── */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: box-shadow 0.25s;
}
.card:hover { box-shadow: 0 5px 18px rgba(0,0,0,0.11); }
.card h2 { color: var(--primary-dark); margin-bottom: 1rem; font-size: 1.05rem; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #444;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="date"], input[type="datetime-local"],
select, textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77,166,255,0.15);
}
textarea { resize: vertical; min-height: 100px; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: #f8f9fa; }
.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
    color: var(--text);
}
.data-table tbody tr:hover { background: #fafbfc; }

/* ─── Status Badges ─── */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.status-pending  { background: var(--warning-bg); color: var(--warning-text); }
.status-approved { background: var(--success-bg); color: var(--success-text); }
.status-rejected { background: var(--danger-bg);  color: var(--danger-text);  }
.status-active   { background: var(--success-bg); color: var(--success-text); }
.status-inactive { background: #e9ecef; color: #555; }

/* ─── Alerts ─── */
.alert-box, .alert-success, .alert-error, .success-message, .error-message {
    padding: 0.85rem 1.1rem;
    border-radius: 7px;
    border-left: 4px solid;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.alert-success, .success-message {
    background: var(--success-bg); color: var(--success-text); border-color: #28a745;
}
.alert-error, .error-message {
    background: var(--danger-bg); color: var(--danger-text); border-color: #dc3545;
}
.alert-warning {
    background: var(--warning-bg); color: var(--warning-text); border-color: #ffc107;
}
.alert-info {
    background: var(--info-bg); color: var(--info-text); border-color: #17a2b8;
}

/* Workflow info box */
.workflow-info {
    background: var(--warning-bg);
    border-left: 4px solid var(--gold);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--warning-text);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

/* ─── Page Container ─── */
.page-container {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    color: var(--dark-text);
    transition: background 0.3s;
}
.pending-requests-header {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ffeaa0;
}
.pending-requests-header h2 {
    margin: 0 0 0.25rem 0;
    color: #856404;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #856404;
    color: white;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 0.72rem;
    font-weight: 700;
}
.pending-card {
    background: #fffdf0;
    border: 1px solid #ffeaa0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 0.75rem 1.25rem;
    transition: box-shadow 0.2s;
}
.pending-card:hover { box-shadow: 0 3px 10px rgba(133,100,4,0.12); }

/* ─── Content grid ─── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

/* ─── Grids ─── */
.grid   { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; }
.hidden { display: none; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .content-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .data-table th, .data-table td { padding: 0.6rem 0.7rem; font-size: 0.83rem; }
}
@media (max-width: 480px) {
    .btn { padding: 0.5rem 0.85rem; font-size: 0.83rem; }
}
