/* style.css */

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --bg: #f8fafc;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 12px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Layout */
.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 20px;
}

.brand a {
    text-decoration: none;
    color: var(--secondary);
    font-size: 1.25rem;
    font-weight: 700;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.2s ease;
}

.main-nav a:hover {
    background: #eff6ff;
    color: var(--primary);
}

/* Main content */
main,
.content {
    padding: 32px 0;
}

h1, h2, h3, h4 {
    color: var(--secondary);
    margin-bottom: 14px;
}

p {
    margin-bottom: 14px;
    color: var(--text);
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

/* Forms */
form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    max-width: 480px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
button,
.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover,
.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--secondary);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border-color: #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    color: var(--secondary);
    font-weight: 700;
}

tr:hover td {
    background: #f9fbff;
}

/* Dashboard stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.stat-box .label {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-box .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
}

/* Login page */
.login-page {
    min-height: calc(100vh - 70px);
    display: grid;
    place-items: center;
    padding: 40px 16px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

/* Links */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* Footer */
.site-footer {
    padding: 20px 0;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
    }

    form {
        max-width: 100%;
    }

    .card,
    form,
    .stat-box {
        padding: 18px;
    }
}