/* ============================================
   DAY ONE! - MAIN STYLESHEET
   ============================================ */

:root {
    --primary:        #3B82F6;
    --primary-dark:   #2563EB;
    --primary-light:  #EFF6FF;
    --secondary:      #64748B;
    --success:        #10B981;
    --danger:         #EF4444;
    --warning:        #F59E0B;

    --navbar-bg:      #1E293B;
    --sidebar-bg:     #F8FAFC;
    --content-bg:     #FFFFFF;
    --border:         #E2E8F0;

    --gray-50:        #F8FAFC;
    --gray-100:       #F1F5F9;
    --gray-200:       #E2E8F0;
    --gray-300:       #CBD5E1;
    --gray-400:       #94A3B8;
    --gray-500:       #64748B;
    --gray-600:       #475569;
    --gray-700:       #334155;
    --gray-800:       #1E293B;
    --gray-900:       #0F172A;

    --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow:     0 1px 3px 0 rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);

    --radius-sm:  0.25rem;
    --radius:     0.375rem;
    --radius-md:  0.5rem;
    --radius-lg:  0.75rem;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--content-bg);
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.25;
}
h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.5rem;  margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.875rem; }
h4 { font-size: 1.1rem;  margin-bottom: 0.75rem; }
h5 { font-size: 1rem;    margin-bottom: 0.625rem; }
h6 { font-size: 0.9rem;  margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }

/* ── Layout ── */
.container       { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.container-fluid { width: 100%; padding: 0 1.5rem; }

/* ── Navbar ── */
.navbar {
    background: var(--navbar-bg);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin-right: 2rem;
}
.navbar-brand:hover { color: white; }

.navbar-spacer { flex: 1; }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.navbar-user span { color: rgba(255,255,255,0.75); font-size: 0.875rem; }

.nav-link {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    transition: color 0.15s;
}
.nav-link:hover { color: white; }

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ── Main layout ── */
.main-layout {
    display: flex;
    min-height: calc(100vh - 49px); /* navbar height */
}

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    overflow-y: auto;
}

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin: 0; }

.sidebar-menu a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    transition: background 0.1s, color 0.1s;
    border-left: 2px solid transparent;
}
.sidebar-menu a:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    border-left-color: var(--gray-300);
}
.sidebar-menu a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-title {
    padding: 1.25rem 1.25rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
}

/* ── Main content ── */
.main-content {
    flex: 1;
    background: var(--content-bg);
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

/* ── Cards ── */
.card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-body { /* no bottom margin — use mb-* utilities instead */ }

.card-footer {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ── Stat cards ── */
.stat-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin: 0.25rem 0 0.125rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }

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

.btn-secondary        { background: var(--gray-200);   color: var(--gray-800); }
.btn-secondary:hover  { background: var(--gray-300);   color: var(--gray-900); }

.btn-success          { background: var(--success);    color: white; }
.btn-success:hover    { background: #059669;            color: white; }

.btn-danger           { background: var(--danger);     color: white; }
.btn-danger:hover     { background: #DC2626;            color: white; }

.btn-warning          { background: var(--warning);    color: white; }
.btn-warning:hover    { background: #D97706;            color: white; }

.btn-sm  { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; }
.btn-lg  { padding: 0.625rem 1.25rem;   font-size: 0.9375rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

textarea { resize: vertical; min-height: 90px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--gray-700);
}

.table tbody tr:hover { background: var(--sidebar-bg); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Alerts ── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border-left: 3px solid;
    font-size: 0.875rem;
}

.alert-success { background: #F0FDF4; border-color: var(--success); color: #166534; }
.alert-danger  { background: #FFF1F2; border-color: var(--danger);  color: #9F1239; }
.alert-warning { background: #FFFBEB; border-color: var(--warning); color: #92400E; }
.alert-info    { background: var(--primary-light); border-color: var(--primary); color: #1E40AF; }

/* ── Progress ── */
.progress {
    height: 0.375rem;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
    margin: 0.375rem 0;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-primary { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    background: var(--content-bg);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* ── Utilities ── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.p-2  { padding: 1rem; }
.p-3  { padding: 1.5rem; }
.p-4  { padding: 2rem; }

.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.gap-2        { gap: 1rem; }
.gap-4        { gap: 2rem; }
.hidden       { display: none; }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-layout    { flex-direction: column; }
    .sidebar        { display: none; }
    .main-content   { padding: 1.25rem; }
    .form-row       { grid-template-columns: 1fr; }
    .card-header    { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
