/* ============================================================
   SPH HelpDesk - Main Stylesheet
   ============================================================ */

:root {
    --primary:     #1a7a4a;
    --primary-dark:#145e38;
    --primary-light:#e8f5ee;
    --accent:      #1a3a5c;
    --danger:      #dc3545;
    --warning:     #ffc107;
    --success:     #198754;
    --bg:          #f4f6f9;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.07);
    --border:      #e2e8f0;
    --text-muted:  #6c757d;
}

/* ── Bootstrap overrides ─────────────────────────────── */
.btn-primary, .bg-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover        { background-color: var(--primary-dark) !important; }
.text-primary             { color: var(--primary) !important; }
.border-primary           { border-color: var(--primary) !important; }
.navbar.bg-primary        { background-color: var(--primary) !important; }
.badge.bg-primary         { background-color: var(--primary) !important; }

/* ── Base ────────────────────────────────────────────── */
body {
    background: var(--bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #2d3748;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.cursor-pointer { cursor: pointer; }

/* ── Auth Pages ──────────────────────────────────────── */
.auth-body {
    background: linear-gradient(135deg, #1a3a5c 0%, #1a7a4a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 36px 32px 28px;
    text-align: center;
    color: #fff;
}

.auth-header h4 {
    margin: 8px 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.auth-header p {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin: 0;
}

.auth-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
    backdrop-filter: blur(4px);
}

.auth-logo {
    max-height: 56px;
    margin-bottom: 12px;
}

.auth-body-inner { padding: 32px; }

.auth-footer {
    background: #f8f9fa;
    padding: 16px 32px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Stat Cards ──────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 20px 16px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    opacity: 0.85;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────── */
.card { border: 1px solid var(--border); border-radius: 12px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 14px; border-radius: 12px 12px 0 0 !important; }

/* ── Navbar ──────────────────────────────────────────── */
.navbar-brand { font-size: 16px; }

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ── Application Items ───────────────────────────────── */
.app-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.app-item:last-child { border-bottom: none; }
.app-item:hover { background: #f8f9fa; }

/* ── Application Summary Card ────────────────────────── */
.app-summary-card {
    background: var(--primary-light);
    border: 1px solid rgba(26,122,74,0.2);
    border-radius: 8px;
    padding: 16px;
}

/* ── Ticket Rows ─────────────────────────────────────── */
.ticket-row-link { display: block; text-decoration: none; color: inherit; }

.ticket-row {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.ticket-row:hover { background: #f8f9fa; }

/* ── Ticket Thread ───────────────────────────────────── */
.ticket-thread { display: flex; flex-direction: column; gap: 0; }

.thread-message {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    position: relative;
}

.thread-student {
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.thread-staff {
    background: var(--primary-light);
    border: 1px solid rgba(26,122,74,0.2);
    box-shadow: var(--card-shadow);
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.thread-body {
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.thread-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.student-avatar { background: #6c757d; }
.staff-avatar   { background: var(--primary); }

.thread-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--primary);
    transition: all .15s;
}

.attachment-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* ── Ticket Info Bar ─────────────────────────────────── */
.ticket-info-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
}

.ticket-info-bar span { color: #4a5568; }

/* ── Tables ──────────────────────────────────────────── */
.table { font-size: 13px; }
.table td { vertical-align: middle; padding: 10px 12px; }
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; }
.table tbody tr:hover { cursor: pointer; }

/* ── Profile Avatar ──────────────────────────────────── */
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* ── Badges ──────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 600; }

/* ── Alert ───────────────────────────────────────────── */
.alert { border-radius: 8px; font-size: 13px; }

/* ── Form ────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #d1d5db;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,122,74,0.12);
}

.input-group-text {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 576px) {
    .auth-body-inner { padding: 24px 20px; }
    .auth-header { padding: 28px 20px; }
    .container-fluid { padding: 12px; }
    .thread-message { padding: 12px 14px; }
    .ticket-info-bar { gap: 10px; font-size: 12px; }
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
