/**
 * File Name:    assets/style.css
 * Description:  Corporate theme variant - sharp corners, navy/slate palette,
 *               restrained accent colour. See noticeboard_test/README.
 */

:root {
    --primary: #0f172a;
    --primary-hover: #1e293b;
    --accent: #2563eb;
    --bg: #f1f5f9;
    --white: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #dbe1e8;
    --shadow: 0 1px 3px rgb(15 23 42 / 0.08);
    --base-font-size: 16px;
}

* { box-sizing: border-box; border-radius: 0 !important; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    margin: 0;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Responsive Header */
header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--accent);
}

@media (min-width: 1024px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.8rem 2rem;
    }
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .header-left {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
}

header h1 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav-link.active {
    color: white;
    background: transparent;
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.auth-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

@media (min-width: 1024px) {
    .auth-box {
        padding-top: 0;
        border-top: none;
    }
}

/* Grid Layouts */
.notice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Desktop Comfortable: Max 3 columns */
@media (min-width: 768px) {
    .notice-grid { grid-template-columns: repeat(auto-fill, minmax(31%, 1fr)); }
}

/* Desktop Compact: Max 4 columns */
body.is-compact .notice-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    body.is-compact .notice-grid { grid-template-columns: repeat(auto-fill, minmax(23%, 1fr)); }
}

/* Standard Components */
main { padding: 1rem; max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px) { main { padding: 2rem; } }

.card {
    background: var(--white);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) { .card { padding: 2rem; } }

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

/* Form Layouts */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row { flex-direction: row; }
    .form-row > div { flex: 1; }
}

label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: 1px solid transparent;
    transition: background-color 0.15s ease;
}

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

/* Login Centre Fix */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    box-shadow: 0 10px 25px rgba(15,23,42,0.06);
}

/* ==========================================================================
   App shell: persistent sidebar for staff-facing pages (dashboard.php)
   ========================================================================== */

.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    background: var(--bg);
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1.25rem;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-sidebar-brand i { color: var(--accent); font-size: 1.1rem; }

.app-sidebar-cta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0.75rem 0.25rem;
    padding: 0.7rem 0.85rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
}
.app-sidebar-cta:hover { background: #1d4ed8; }

.app-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}
.app-sidebar-link i { width: 16px; text-align: center; font-size: 0.85rem; }
.app-sidebar-link:hover { color: white; background: rgba(255,255,255,0.05); }
.app-sidebar-link.active {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
    font-weight: 700;
}

.app-sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.app-sidebar-logout:hover { color: #fca5a5; }

.app-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 2rem 3rem;
}

.app-topstrip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.app-topstrip h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.app-topstrip-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}

/* ==========================================================================
   Master-detail split panel (dashboard.php)
   ========================================================================== */

.single-panel { max-width: 1100px; }
.single-panel-narrow { max-width: 720px; }

.panel-card {
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.panel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.panel-card-header h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.panel-card-body { padding: 1.25rem; }
.panel-card-body.no-pad { padding: 0; }

.notice-row-list { display: flex; flex-direction: column; }
.notice-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}
.notice-row:last-child { border-bottom: none; }
.notice-row:hover { background: #f8fafc; }
.notice-row-color {
    width: 6px;
    align-self: stretch;
    flex-shrink: 0;
}
.notice-row-main { flex: 1; min-width: 0; }
.notice-row-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notice-row-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.15rem;
}
.notice-row-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}
.icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.icon-btn-danger:hover { border-color: #ef4444; color: #ef4444; }

/* Status/notification pills - the one deliberate exception to sharp corners */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999px !important;
    white-space: nowrap;
}
.pill-active { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.pill-expired { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.pill-archived { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.pill-new { background: #ef4444; color: white; }
.pill-pinned { background: #dcfce7; color: #166534; }
.pill-accent { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
