/* /public/assets/css/app.css */
/* WorkAround – sentral stylesheet */

:root {
    --wa-primary:      #0d6efd;
    --wa-sidebar-bg:   #1a2035;
    --wa-sidebar-text: #adb5bd;
    --wa-sidebar-w:    240px;
    --wa-header-h:     56px;
    --wa-border:       #dee2e6;
    --wa-card-shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --wa-body-bg:      #f4f6f9;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .9rem;
    background: var(--wa-body-bg);
    color: #212529;
    margin: 0;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.wa-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--wa-sidebar-w);
    height: 100vh;
    background: var(--wa-sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: transform .25s ease;
}
.wa-sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    gap: .5rem;
}
.wa-sidebar-brand small {
    font-size: .65rem;
    font-weight: 400;
    color: var(--wa-sidebar-text);
    display: block;
    margin-top: .1rem;
}
.wa-nav-section {
    padding: .75rem 1rem .25rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.3);
}
.wa-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.25rem;
    color: var(--wa-sidebar-text);
    text-decoration: none;
    font-size: .85rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.wa-nav-link:hover,
.wa-nav-link.active {
    background: rgba(255,255,255,.07);
    color: #fff;
    border-left-color: var(--wa-primary);
}
.wa-nav-link .badge { margin-left: auto; }
.wa-nav-link i { width: 18px; text-align: center; flex-shrink: 0; }

/* ── Main layout ───────────────────────────────────────────── */
.wa-main {
    margin-left: var(--wa-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top bar ───────────────────────────────────────────────── */
.wa-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--wa-header-h);
    background: #fff;
    border-bottom: 1px solid var(--wa-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}
.wa-topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #212529;
    flex: 1;
}
.wa-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* ── Content ───────────────────────────────────────────────── */
.wa-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--wa-border);
    border-radius: .5rem;
    box-shadow: var(--wa-card-shadow);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--wa-border);
    padding: .875rem 1.25rem;
    font-weight: 600;
    font-size: .9rem;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.wa-stat-card {
    border-radius: .5rem;
    padding: 1.25rem;
    color: #fff;
    box-shadow: var(--wa-card-shadow);
}
.wa-stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.wa-stat-card .stat-label { font-size: .78rem; opacity: .85; margin-top: .25rem; }

/* ── Status badges ─────────────────────────────────────────── */
.badge { font-size: .72rem; font-weight: 600; padding: .25em .6em; border-radius: .35rem; }

/* ── Priority indicators ───────────────────────────────────── */
.priority-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.priority-dot.hoy    { background: #dc3545; }
.priority-dot.middels{ background: #ffc107; }
.priority-dot.lav    { background: #6c757d; }

/* ── Tables ─────────────────────────────────────────────────── */
.table th {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(13, 110, 253, .04); }
.table-sm td, .table-sm th { padding: .45rem .75rem; }
.table a { color: var(--wa-primary); text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ── Workorder list rows ─────────────────────────────────────── */
.wo-row-priority-hoy { border-left: 3px solid #dc3545; }
.wo-row-priority-middels { border-left: 3px solid #ffc107; }
.wo-row-priority-lav { border-left: 3px solid transparent; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: #495057; }
.form-control, .form-select {
    font-size: .875rem;
    border-color: #ced4da;
    border-radius: .375rem;
}
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}
.form-section {
    background: #f8f9fa;
    border: 1px solid var(--wa-border);
    border-radius: .5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.form-section-title {
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #495057;
    margin-bottom: 1rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn { font-size: .85rem; font-weight: 500; border-radius: .375rem; }
.btn-lg { font-size: .95rem; padding: .6rem 1.5rem; }
.btn-sm { font-size: .78rem; }

/* ── Flash messages ─────────────────────────────────────────── */
.wa-flash { border-radius: .5rem; padding: .85rem 1.25rem; margin-bottom: 1rem; font-size: .875rem; }

/* ── Comment thread ─────────────────────────────────────────── */
.wa-comment {
    padding: .875rem;
    border-radius: .5rem;
    margin-bottom: .75rem;
}
.wa-comment.intern { background: #f8f9fa; border-left: 3px solid #0d6efd; }
.wa-comment.ekstern { background: #fff3cd; border-left: 3px solid #ffc107; }
.wa-comment.notat { background: #e8f5e9; border-left: 3px solid #28a745; }
.wa-comment.system { background: #f0f0f0; border-left: 3px solid #adb5bd; font-size: .8rem; color: #6c757d; }
.wa-comment.montornotat { background: #e3f2fd; border-left: 3px solid #17a2b8; }
.wa-comment-meta { font-size: .75rem; color: #6c757d; margin-top: .35rem; }

/* ── Status timeline ────────────────────────────────────────── */
.wa-timeline { position: relative; padding-left: 1.5rem; }
.wa-timeline::before {
    content: '';
    position: absolute;
    left: .55rem; top: 0; bottom: 0;
    width: 2px;
    background: var(--wa-border);
}
.wa-timeline-item { position: relative; padding-bottom: 1rem; }
.wa-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.15rem; top: .35rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--wa-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--wa-primary);
}
.wa-timeline-meta { font-size: .75rem; color: #6c757d; }

/* ── Sidebar toggle (mobile) ────────────────────────────────── */
.sidebar-toggle { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .wa-sidebar {
        transform: translateX(-100%);
    }
    .wa-sidebar.open {
        transform: translateX(0);
    }
    .wa-main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .wa-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1025;
    }
    .wa-sidebar-overlay.open {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .wa-content { padding: 1rem .75rem; }
    .wa-topbar { padding: 0 .75rem; }
    .hide-mobile { display: none !important; }
}

/* ── Mobile card list (instead of table) ────────────────────── */
.wo-card-mobile {
    display: none;
}
@media (max-width: 767.98px) {
    .wo-table-desktop { display: none !important; }
    .wo-card-mobile { display: block; }
}
.wo-mobile-card {
    background: #fff;
    border: 1px solid var(--wa-border);
    border-radius: .5rem;
    padding: .875rem;
    margin-bottom: .75rem;
    box-shadow: var(--wa-card-shadow);
    text-decoration: none;
    color: inherit;
    display: block;
}
.wo-mobile-card:hover { border-color: var(--wa-primary); }
.wo-mobile-card .wo-number { font-size: .75rem; color: #6c757d; }
.wo-mobile-card .wo-title { font-weight: 600; font-size: .925rem; margin: .25rem 0; }
.wo-mobile-card .wo-meta { font-size: .75rem; color: #6c757d; display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Login page ─────────────────────────────────────────────── */
.wa-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2035 0%, #1e3a5f 100%);
    padding: 1.5rem;
}
.wa-login-card {
    background: #fff;
    border-radius: .75rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.wa-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.wa-login-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a2035;
    margin: .5rem 0 .25rem;
}
.wa-login-logo small {
    color: #6c757d;
    font-size: .8rem;
}

/* ── Notification bell ──────────────────────────────────────── */
.wa-notif-btn {
    position: relative;
    background: none;
    border: none;
    padding: .35rem .5rem;
    color: #495057;
    cursor: pointer;
    border-radius: .375rem;
}
.wa-notif-btn:hover { background: #f0f0f0; }
.wa-notif-count {
    position: absolute;
    top: 2px; right: 2px;
    background: #dc3545;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ── Filter bar ─────────────────────────────────────────────── */
.wa-filter-bar {
    background: #fff;
    border: 1px solid var(--wa-border);
    border-radius: .5rem;
    padding: .875rem 1rem;
    margin-bottom: 1rem;
}

/* ── Utility ─────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.font-mono { font-family: monospace; }
