* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}

/* ---- Login page ---- */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
    background: #fff; padding: 2.5rem; border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 320px;
}
.login-box h1 { margin-top: 0; font-size: 1.4rem; }
.login-box label { display: block; margin: .8rem 0 .3rem; font-size: .85rem; color: #555; }
.login-box input { width: 100%; padding: .6rem; border: 1px solid #ddd; border-radius: 6px; }
.login-box button {
    margin-top: 1.5rem; width: 100%; padding: .7rem; border: none; border-radius: 6px;
    background: #2f6feb; color: #fff; font-weight: 600; cursor: pointer;
}
.login-box button:hover { background: #245ac0; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: #1a1e2b; color: #fff; padding: 1.5rem 1rem;
    display: flex; flex-direction: column;
}
.sidebar h2 { font-size: 1.1rem; margin-bottom: 1.5rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.sidebar nav a { color: #c7cbe0; text-decoration: none; padding: .6rem .7rem; border-radius: 6px; font-size: .9rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: #2f6feb; color: #fff; }
.sidebar .logout { color: #f2a; text-decoration: none; font-size: .8rem; padding-top: 1rem; }

.content { flex: 1; padding: 2rem 2.5rem; max-width: 900px; }
.content h1 { margin-top: 0; }

/* ---- Forms ---- */
.form { background: #fff; padding: 1.5rem; border-radius: 8px; max-width: 640px; }
.form label { display: block; margin: 1rem 0 .3rem; font-weight: 600; font-size: .85rem; }
.form input[type=text], .form input[type=number], .form textarea, .form input[type=file] {
    width: 100%; padding: .6rem; border: 1px solid #ddd; border-radius: 6px; font-family: inherit;
}
.form textarea.mono { font-family: 'SF Mono', Consolas, monospace; font-size: .8rem; }
.form .hint { font-size: .75rem; color: #888; margin-top: .2rem; }
.form .preview { max-width: 160px; border-radius: 6px; margin: .5rem 0; display: block; }

/* ---- Buttons ---- */
.btn {
    display: inline-block; background: #2f6feb; color: #fff; padding: .6rem 1.2rem;
    border: none; border-radius: 6px; text-decoration: none; font-weight: 600; cursor: pointer;
    margin-top: 1.2rem; font-size: .9rem;
}
.btn:hover { background: #245ac0; }

/* ---- Alerts ---- */
.alert { background: #ffe3e3; color: #b30000; padding: .7rem 1rem; border-radius: 6px; font-size: .9rem; }
.alert.success { background: #dff6e0; color: #14702c; }

/* ---- Dashboard cards ---- */
.card-grid { display: flex; gap: 1rem; margin: 1.5rem 0; }
.stat-card { background: #fff; padding: 1.5rem 2rem; border-radius: 8px; text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: #2f6feb; }
.stat-label { font-size: .85rem; color: #777; }
.quick-links { display: flex; gap: .8rem; flex-wrap: wrap; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; margin-top: 1rem; }
.data-table th, .data-table td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid #eee; font-size: .88rem; }
.data-table th { background: #f0f1f5; }
.data-table tr.unread { background: #f0f6ff; font-weight: 600; }
.thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
