/* ============================================
   Virkisskipan — Sidebar layout inspired by portal.bizconnect.dk
   ============================================ */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    background: #f0f4f8;
}

a {
    color: #1a3a6b;
    text-decoration: none;
}
a:hover {
    color: #c00;
}

/* ---- App wrapper (sidebar + main) ---- */
.app-wrap {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.sidebar-logo a {
    text-decoration: none;
}
.logo-tg {
    color: #c00;
    font-weight: 800;
    font-size: 1.6em;
}
.logo-delta {
    color: #0a5c36;
    font-weight: 800;
    font-size: 1.6em;
}
.logo-text {
    color: #1a3a6b;
    font-weight: 600;
    font-size: 1.2em;
    margin-left: 2px;
}

/* ---- Sidebar navigation ---- */
.sidebar-nav {
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #3c3c3c;
    font-size: 0.93em;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.menu-item:hover {
    background: linear-gradient(to right, #dbeafe, #fff);
    color: #1a3a6b;
}
.menu-item.active {
    background: linear-gradient(to right, #b3d4fc, #fff);
    color: #1a3a6b;
    font-weight: 600;
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: #1a3a6b;
}

.menu-section {
    margin-top: 2px;
}

.menu-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #3c3c3c;
    font-size: 0.93em;
    font-weight: 500;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-heading:hover {
    background: linear-gradient(to right, #dbeafe, #fff);
}
.menu-heading .chevron {
    margin-left: auto;
    transition: transform 0.2s;
    color: #9ca3af;
}
.menu-heading.open .chevron {
    transform: rotate(180deg);
}

.menu-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.menu-sub.open {
    max-height: 600px;
}

.menu-item.sub {
    padding: 7px 20px 7px 52px;
    font-size: 0.88em;
}

/* ---- Main content ---- */
.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 50%, #c7d8f0 100%);
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: 0;
}

/* ---- Top bar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 30px;
    background: transparent;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    color: #1a3a6b;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-toggle-sidebar:hover {
    background: rgba(255,255,255,0.5);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    color: #4b5563;
    font-size: 0.9em;
}

.lang-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
}

.lang-flag {
    font-size: 1.4em;
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.15s;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
}

.lang-flag:hover {
    opacity: 0.8;
}

.lang-flag.active {
    opacity: 1;
    background: rgba(26, 58, 107, 0.1);
}

.btn-logout {
    background: #1a3a6b;
    color: #fff;
    border: none;
    padding: 7px 20px;
    border-radius: 20px;
    font-size: 0.88em;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-logout:hover {
    background: #c00;
}

/* ---- Content card ---- */
.content-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin: 0 30px;
    flex: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}
h1 {
    font-weight: 700;
    color: #1a3a6b;
    font-size: 1.6em;
}
h3 {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.15em;
}

/* ---- Footer ---- */
.app-footer {
    text-align: center;
    padding: 16px;
    color: #6b7280;
    font-size: 0.85em;
}

/* ---- Login page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a6b 0%, #2d5aa0 100%);
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .logo-tg {
    font-size: 2em;
}
.login-card .logo-text {
    font-size: 1.5em;
}
.login-card h2 {
    color: #1a3a6b;
    margin: 20px 0 6px;
    font-size: 1.3em;
}
.login-card .subtitle {
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 0.9em;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    font-size: 0.95em;
}
.login-card .form-control:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: #1a3a6b;
    color: #fff;
    border: none;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.login-card .btn-login:hover {
    background: #2d5aa0;
}

/* ---- Form styling ---- */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ---- Bootstrap overrides — Buttons ---- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 18px;
    font-size: 0.9em;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.82em;
    border-radius: 6px;
}
.btn-primary {
    background: #1a3a6b;
    border-color: #1a3a6b;
    box-shadow: 0 2px 6px rgba(26,58,107,0.2);
}
.btn-primary:hover {
    background: #2d5aa0;
    border-color: #2d5aa0;
    box-shadow: 0 4px 12px rgba(26,58,107,0.3);
    transform: translateY(-1px);
}
.btn-success {
    background: #0d7a3e;
    border-color: #0d7a3e;
    box-shadow: 0 2px 6px rgba(13,122,62,0.2);
}
.btn-success:hover {
    background: #0a6332;
    border-color: #0a6332;
    box-shadow: 0 4px 12px rgba(13,122,62,0.3);
    transform: translateY(-1px);
}
.btn-outline-secondary {
    border-color: #d1d5db;
    color: #4b5563;
}
.btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}
.btn-outline-success {
    border-color: #0d7a3e;
    color: #0d7a3e;
}
.btn-outline-success:hover {
    background: #0d7a3e;
    border-color: #0d7a3e;
}
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}
.btn-outline-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
}

/* ---- Tables ---- */
.table {
    border-collapse: separate;
    border-spacing: 0;
}
.table > thead > tr > th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.82em;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 2px solid #e5e7eb;
}
.table > tbody > tr {
    transition: background 0.15s;
}
.table-hover > tbody > tr:hover {
    background: rgba(26,58,107,0.04);
}
.table tfoot td {
    font-weight: bold;
    border-top: 2px solid #333;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    font-size: 0.78em;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* ---- Alerts ---- */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9em;
}

/* ---- Dashboard cards ---- */
.dash-card {
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.dash-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.dash-icon {
    opacity: 0.85;
    margin-bottom: 12px;
}
.dash-label {
    font-size: 0.85em;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.dash-value {
    font-size: 2.4em;
    font-weight: 700;
    line-height: 1.1;
    margin: 4px 0 12px;
}
.dash-link {
    color: rgba(255,255,255,0.85);
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.dash-link:hover { color: #fff; }

.dash-stock { background: linear-gradient(135deg, #1a3a6b 0%, #2d5aa0 100%); }
.dash-production { background: linear-gradient(135deg, #0d7a3e 0%, #1aab5c 100%); }
.dash-landings { background: linear-gradient(135deg, #0c6e8a 0%, #17a2b8 100%); }
.dash-containers { background: linear-gradient(135deg, #b8600b 0%, #e89a3c 100%); }

.card.text-white a {
    color: rgba(255,255,255,0.85);
}
.card.text-white a:hover {
    color: #fff;
}

/* ---- Company header — hidden on screen, visible when printing ---- */
.company-header {
    display: none;
}
.print-only {
    display: none;
}

/* ---- Print styles ---- */
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .btn, form.report-filters {
        display: none !important;
    }
    .company-header {
        display: block !important;
    }
    .print-only {
        display: block !important;
    }
    .main-content {
        margin-left: 0 !important;
        background: none !important;
    }
    .content-card {
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body { margin: 0; background: #fff !important; }
    .container, .container-fluid { max-width: 100%; padding: 0; }
    .table { font-size: 11px; }
    .table th, .table td { padding: 2px 6px; }
    h1 { font-size: 18px; margin-bottom: 8px; }
    .report-header { margin-bottom: 10px; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-card {
        margin: 0 12px;
        padding: 16px;
        border-radius: 12px;
    }
    .topbar {
        padding: 10px 16px;
    }
}

/* ---- User management table ---- */
.users-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.88em;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
