/* ── Suomimuutto Laatikkovuokraus — Modern UI ── */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(59,130,246,0.15);
    --sidebar-width: 240px;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface-alt);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 1;
}
.sidebar-brand a {
    display: block;
}
.sidebar-brand img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0.25rem;
    filter: brightness(1.1);
}
.sidebar-brand .brand-text {
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.sidebar .nav {
    padding: 0.75rem 0.75rem;
    flex: 1;
}
.sidebar .nav-item { margin-bottom: 2px; }

.sidebar .nav-link {
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
}
.sidebar .nav-link i { font-size: 1rem; opacity: 0.7; }
.sidebar .nav-link:hover {
    color: rgba(255,255,255,0.9);
    background: var(--sidebar-hover);
}
.sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
}
.sidebar .nav-link.active i { opacity: 1; color: var(--accent); }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-footer .user-name {
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 500;
}
.sidebar-footer a {
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    text-decoration: none;
    transition: var(--transition);
}
.sidebar-footer a:hover { color: rgba(255,255,255,0.8); }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem 2rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-header h1, .page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.page-header .text-muted {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Cards ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.15rem;
    font-weight: 600;
    font-size: 0.85rem;
}
.card-body { padding: 1.15rem; }
.card-footer {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    padding: 1rem 1.15rem;
}

/* ── Stat Cards ── */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ── Tables ── */
.table {
    font-size: 0.84rem;
    margin-bottom: 0;
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    padding: 0.65rem 0.75rem;
}
.table td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.table-hover tbody tr:hover { background: rgba(59,130,246,0.03); }

/* ── Badges ── */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
    letter-spacing: 0.01em;
}
.badge-tilattu {
    background: rgba(100,116,139,0.12);
    color: #475569;
}
.badge-toimitettu {
    background: rgba(59,130,246,0.12);
    color: #2563eb;
}
.badge-palautettu {
    background: rgba(245,158,11,0.12);
    color: #d97706;
}
.badge-laskutettu {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}

/* ── Buttons ── */
.btn {
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    transition: var(--transition);
}
.btn-sm {
    font-size: 0.76rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ── Forms ── */
.form-control, .form-select {
    font-size: 0.84rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

/* ── Alerts ── */
.alert {
    border-radius: var(--radius);
    font-size: 0.84rem;
    border: none;
}

/* ── Calendar ── */
.calendar-table { table-layout: fixed; }
.calendar-cell {
    vertical-align: top;
    height: 100px;
    padding: 6px 8px;
}
.calendar-today {
    border: 2px solid var(--accent) !important;
    background: rgba(59,130,246,0.04);
}
.calendar-empty { background: var(--surface-alt); }
.calendar-cell .badge {
    font-size: 0.7rem;
    max-width: 100%;
}

/* ── Login Page ── */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(14,165,233,0.06) 0%, transparent 50%),
        var(--surface-alt);
}
.login-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.login-card .card-body { padding: 2rem 2rem; }
.login-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.login-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Invoice ── */
.invoice-page {
    max-width: 800px;
    margin: 0 auto;
    font-size: 0.9rem;
}

/* ── Responsive ── */

/* Mobile nav hidden on desktop */
.mobile-nav { display: none; }

@media (max-width: 991px) {
    .sidebar { display: none; }
    .mobile-nav { display: block; }
    .main-content { margin-left: 0; }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .page-header .d-flex { width: 100%; }
}

@media (max-width: 768px) {
    .main-content { padding: 0.75rem; }
    .stat-card .stat-number { font-size: 1.5rem; }
    .stat-card .stat-label { font-size: 0.7rem; }
    .calendar-cell {
        height: auto;
        min-height: 50px;
        padding: 3px 4px;
        font-size: 0.75rem;
    }
    .calendar-cell .badge { font-size: 0.58rem; padding: 0.2em 0.4em; }
    .calendar-table th { font-size: 0.72rem; padding: 4px 2px; }
    .page-header h1, .page-header h2 { font-size: 1.15rem; }
    .table { font-size: 0.78rem; }
    .table th { font-size: 0.7rem; }
    .table td, .table th { padding: 0.5rem 0.5rem; }
    .card-header { padding: 0.7rem 0.85rem; font-size: 0.8rem; }
    .card-body { padding: 0.85rem; }
    .btn { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
    .btn-sm { font-size: 0.72rem; }
}

@media (max-width: 576px) {
    .main-content { padding: 0.5rem; }
    .row.g-4 { --bs-gutter-y: 0.75rem; }
    .stat-card .stat-number { font-size: 1.3rem; }
}

/* ── Print ── */
@media print {
    .no-print, .sidebar, .d-print-none { display: none !important; }
    .main-content { margin-left: 0; padding: 0; }
    .card { border: none; box-shadow: none; }
}
