/* Import Ubuntu font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
    --penta-navy: #002d58;
    --toa-blue: #005eb8;
    --accent-gold: #f39c12;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

/* --- Base Reset --- */
* { box-sizing: border-box; }

body {
    font-family: 'Ubuntu', sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout Components --- */
header {
    background: linear-gradient(135deg, var(--penta-navy) 0%, var(--toa-blue) 100%);
    color: white;
    padding: 2rem 1rem 4rem 1rem;
    text-align: center;
}

header h1 { margin: 0; font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
header p { margin-top: 5px; opacity: 0.8; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; }

.container {
    max-width: 1000px;
    margin: -30px auto 50px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    padding: 24px 30px;
    margin-bottom: 20px;
}

/* --- Navigation --- */
.admin-nav {
    background: var(--penta-navy);
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 0.85rem;
}

/* --- Index Page: Table List View --- */
.search-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#siteSearch {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.pill.active { background: var(--penta-navy); color: white; border-color: var(--penta-navy); }

.list-wrapper {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.list-header-row {
    display: grid;
    grid-template-columns: 160px 1fr 100px 40px;
    background: #f8fafc;
    padding: 10px 20px;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.list-row-item {
    display: grid;
    grid-template-columns: 160px 1fr 100px 40px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background 0.15s;
}

.list-row-item:hover { background: #f8fafc; }

.ref-text { font-family: monospace; font-weight: 700; color: var(--toa-blue); font-size: 0.85rem; }
.row-title { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--penta-navy); }
.row-preview { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }

/* --- Detail Page (Full Read) Scaling --- */
.card h1 {
    font-size: 1.4rem; 
    line-height: 1.3;
    margin: 10px 0 15px 0;
    color: var(--penta-navy);
    font-weight: 500;
}

.notice-body, .card p, .card div {
    font-size: 0.9rem; 
    color: #334155;
    line-height: 1.5;
}

.category-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: #e0f2fe;
    color: var(--toa-blue);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* --- Dashboard Specifics --- */
.dashboard-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.side-form { flex: 0 0 360px; }
.main-content { flex: 1; min-width: 450px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }

.modern-input {
    width: 100%;
    padding: 9px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Ubuntu', sans-serif;
}

.btn-publish {
    width: 100%;
    background: var(--penta-navy);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}
/* Preserve formatting from the textarea */
.notice-body {
    white-space: pre-line; /* This is the magic line */
    word-wrap: break-word;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
    display: block;
}

.modern-table { width: 100%; border-collapse: collapse; }
.modern-table th { text-align: left; padding: 10px; background: #f8fafc; font-size: 0.75rem; color: var(--text-muted); border-bottom: 2px solid var(--border-color); }
.modern-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }

.action-group { display: flex; gap: 6px; justify-content: flex-end; }
.btn-edit { background: #e0f2fe; color: #0369a1; padding: 5px 10px; border-radius: 4px; text-decoration: none; font-weight: 700; font-size: 0.7rem; }
.btn-delete { background: #fee2e2; color: #b91c1c; padding: 5px 10px; border-radius: 4px; border: none; font-weight: 700; font-size: 0.7rem; cursor: pointer; }

/* --- Login Page --- */
.login-body {
    background: linear-gradient(rgba(0,45,88,0.8), rgba(0,45,88,0.8)), url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card { background: white; padding: 40px; border-radius: 15px; width: 380px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); }

/* --- Mobile --- */
@media (max-width: 768px) {
    .list-header-row { display: none; }
    .list-row-item { grid-template-columns: 1fr; }
    .side-form, .main-content { flex: 1 1 100%; min-width: 100%; }
}
