
:root{
    --nav:#0f1a2e;
    --blue:#1769c8;
    --text:#071f45;
    --muted:#617391;
    --bg:#f3f7fc;
    --card:#ffffff;
    --border:#d9e4f2;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
    display:flex;
    min-height:100vh;
}

/* ===========================
   Sidebar
=========================== */

.sidebar{
    width:280px;
    background:var(--nav);
    color:#fff;
    padding:28px 24px;
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    overflow:auto;
}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:40px;
}

.logo{
    width:58px;
    height:58px;
    border-radius:14px;
    background:var(--blue);
    display:grid;
    place-items:center;
    font-size:26px;
    font-weight:900;
}

.brand span{
    display:block;
    margin-top:5px;
    font-weight:400;
}

nav a{
    display:block;
    color:white;
    text-decoration:none;
    padding:15px 18px;
    margin:6px 0;
    border-radius:12px;
    font-size:18px;
    transition:.15s;
}

nav a:hover,
nav a.active{
    background:#2847a5;
}

/* ===========================
   Main
=========================== */

.main{
    margin-left:280px;
    width:calc(100% - 280px);
    padding:50px;
}

h1{
    margin:0;
    font-size:42px;
}

h2{
    margin-top:0;
}

.lead{
    color:var(--muted);
    font-size:22px;
}

/* ===========================
   Buttons
=========================== */

.btn,
.button{
    display:inline-block;
    background:var(--blue);
    color:white;
    text-decoration:none;
    border:none;
    border-radius:12px;
    padding:14px 22px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
}

.btn.secondary{
    background:#e7eef8;
    color:#16355d;
}

.btn.danger{
    background:#b42318;
    color:#fff;
}

.actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:flex-end;
}

/* ===========================
   Layout
=========================== */

.top-row{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:20px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:20px;
}

.card{
    background:white;
    border:1px solid var(--border);
    border-radius:18px;
    padding:24px;
    box-shadow:0 12px 30px rgba(0,0,0,.05);
}

/* ===========================
   Dashboard Stats
=========================== */

.stat-title{
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:.08em;
    color:#5b6f8d;
    font-weight:700;
    margin-bottom:12px;
}

.stat-number{
    font-size:30px !important;
    font-weight:700;
    line-height:1.2;
    white-space:normal;
    word-break:break-word;
    overflow-wrap:anywhere;
}

/* ===========================
   Cards
=========================== */

.cards{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:18px;
}

.customer-card,
.instrument-card{
    display:block;
    text-decoration:none;
    color:inherit;
    background:white;
    border:1px solid var(--border);
    border-radius:18px;
    padding:22px;
    transition:.2s;
}

.customer-card:hover,
.instrument-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 30px rgba(0,0,0,.08);
}

.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
    margin-top:10px;
}

.badge.good{
    background:#dff7e8;
    color:#0d6b34;
}

.badge.warn{
    background:#fff5d8;
    color:#946000;
}

.badge.bad{
    background:#ffe2e2;
    color:#a10000;
}

.badge.neutral{
    background:#e7eef8;
    color:#44546a;
}

/* ===========================
   Tables
=========================== */

.table{
    width:100%;
    border-collapse:collapse;
}

.table th{
    text-align:left;
    padding:12px;
    border-bottom:2px solid var(--border);
}

.table td{
    padding:12px;
    border-bottom:1px solid var(--border);
}

/* ===========================
   Forms
=========================== */

label{
    display:block;
    margin-top:16px;
    margin-bottom:6px;
    font-weight:700;
}

input,
select,
textarea{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    font-size:15px;
}

textarea{
    min-height:120px;
}

.search{
    width:100%;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    font-size:16px;
    margin-bottom:20px;
}

/* ===========================
   Alerts
=========================== */

.alert{
    padding:16px;
    border-radius:12px;
    margin-bottom:20px;
}

.alert.good{
    background:#e3f8eb;
    color:#006b2d;
}

.alert.bad{
    background:#ffe4e4;
    color:#990000;
}

/* ===========================
   Footer
=========================== */

footer{
    margin-top:40px;
    color:#6f82a3;
}

/* ===========================
   Responsive
=========================== */

@media (max-width:1400px){

    .grid{
        grid-template-columns:repeat(2,1fr);
    }

}

@media (max-width:900px){

    body{
        display:block;
    }

    .sidebar{
        position:relative;
        width:100%;
        height:auto;
    }

    .main{
        margin-left:0;
        width:100%;
        padding:25px;
    }

    .grid{
        grid-template-columns:1fr;
    }

    .top-row{
        flex-direction:column;
    }

    h1{
        font-size:34px;
    }

    .stat-number{
        font-size:26px !important;
    }

}
/* ===========================
   Engineer Portal / Work Orders
=========================== */
.work-card{
    display:block;
    text-decoration:none;
    color:inherit;
    background:white;
    border:1px solid var(--border);
    border-radius:18px;
    padding:20px;
    transition:.2s;
}
.work-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 30px rgba(0,0,0,.08);
}
.wo-title{
    font-size:20px;
    font-weight:800;
    margin-bottom:8px;
}
.muted{
    color:var(--muted);
}
.actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}
.quick-form{
    display:flex;
    gap:12px;
    align-items:end;
    flex-wrap:wrap;
}
.quick-form label{
    margin-top:0;
}
.quick-form select,
.quick-form input{
    min-width:180px;
}
.badge.new{background:#e7eef8;color:#16355d;}
.badge.scheduled{background:#e4f0ff;color:#07539e;}
.badge.in-progress{background:#fff5d8;color:#946000;}
.badge.waiting-parts,.badge.waiting-po{background:#ffe8d8;color:#9b4200;}
.badge.complete{background:#dff7e8;color:#0d6b34;}

/* ===========================
   Enhanced Customer Directory
=========================== */

.summary-strip{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:14px;
    margin:18px 0 24px;
}

.summary-tile{
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:18px;
    padding:18px 20px;
    box-shadow:0 10px 28px rgba(0,0,0,.045);
}

.summary-tile span{
    display:block;
    color:#5b6f8d;
    font-weight:700;
    font-size:12px;
    letter-spacing:.06em;
    text-transform:uppercase;
    margin-bottom:8px;
}

.summary-tile strong{
    display:block;
    font-size:30px;
    color:#08224a;
    line-height:1;
}

.customer-cards{
    align-items:stretch;
}

.enhanced-card{
    display:flex;
    flex-direction:column;
    gap:14px;
    min-height:330px;
    border-top:4px solid #1f6fd1;
}

.card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.card-head h2{
    margin:0;
    line-height:1.15;
}

.customer-location{
    color:#516987;
    margin:0;
    font-weight:600;
}

.customer-meta{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    color:#0a244d;
}

.customer-meta p{
    margin:0;
    line-height:1.35;
    word-break:break-word;
}

.customer-meta strong{
    color:#5b6f8d;
    font-size:12px;
    letter-spacing:.03em;
    text-transform:uppercase;
}

.customer-card-footer{
    margin-top:auto;
    border-top:1px solid var(--border);
    padding-top:14px;
    display:flex;
    flex-direction:column;
    gap:8px;
    color:#0a244d;
    font-weight:600;
}

.mini-badge{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
}

.mini-badge.good{ background:#dff7e8; color:#0d6b34; }
.mini-badge.warn{ background:#fff5d8; color:#946000; }
.mini-badge.bad{ background:#ffe2e2; color:#a10000; }

.open-customer{
    color:#1f6fd1;
    font-weight:800;
    margin-top:2px;
}
/* ===========================
   Clickable Portal Brand
=========================== */

.brand-home-link{
    color:inherit;
    text-decoration:none;
    cursor:pointer;
    transition:opacity .15s ease;
}

.brand-home-link:hover{
    color:inherit;
    text-decoration:none;
    opacity:.88;
}

.brand-home-link:focus-visible{
    outline:2px solid rgba(255,255,255,.9);
    outline-offset:4px;
    border-radius:10px;
}
/* Clickable logo styling */

.brand-home-link,
.brand-home-link:visited,
.brand-home-link:hover,
.brand-home-link:active{
    color:#ffffff;
    text-decoration:none;
}

.brand-home-link strong{
    color:#ffffff;
}

.brand-home-link span{
    color:#d6e3f5;
}

.brand-home-link:hover{
    opacity:.9;
}
.summary-filter {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.summary-filter:hover {
    transform: translateY(-2px);
    border-color: #246fd1;
    box-shadow: 0 10px 24px rgba(20, 59, 110, 0.14);
}

.summary-filter.selected {
    border: 2px solid #246fd1;
    background: #eef5ff;
}

.filter-notice {
    margin: 14px 0;
    padding: 12px 16px;
    border: 1px solid #cbdcf5;
    border-radius: 10px;
    background: #f4f8ff;
}

.filter-notice a {
    margin-left: 8px;
    font-weight: 700;
}
.operations-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0 20px;
}

.operation-summary {
    padding: 14px 18px;
    border: 1px solid #d5dfed;
    border-radius: 14px;
    background: #ffffff;
}

.operations-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0 20px;
}

.operation-summary {
    display: block;
    padding: 16px 18px;
    border: 1px solid #d5dfed;
    border-radius: 14px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.operation-summary span {
    display: block;
    margin-bottom: 5px;
    color: #60708a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.operation-summary strong {
    display: block;
    margin-bottom: 5px;
    color: #071a3d;
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
}

.operation-summary small {
    display: block;
    color: #60708a;
    font-size: 12px;
}

.operation-link,
.operation-link:link,
.operation-link:visited,
.operation-link:hover {
    color: inherit;
    text-decoration: none;
}

.operation-link:hover {
    transform: translateY(-2px);
    border-color: #246fd1;
    box-shadow: 0 10px 24px rgba(20, 59, 110, 0.14);
}

.operation-link:hover small {
    color: #246fd1;
}

@media (max-width: 850px) {
    .operations-strip {
        grid-template-columns: 1fr;
    }
}
}

.operation-summary strong {
    color: #071a3d;
    font-size: 26px;
}

.customer-health {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    padding-top: 14px;
    border-top: 1px solid #dce5f1;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.health-badge.good {
    color: #146c43;
    background: #dcf7e8;
}

.health-badge.warn {
    color: #875b00;
    background: #fff0c7;
}

.health-badge.bad {
    color: #a32626;
    background: #ffe0e0;
}

.health-badge.neutral {
    color: #44546b;
    background: #eaf0f7;
}

@media (max-width: 850px) {
    .operations-strip {
        grid-template-columns: 1fr;
    }
}
.summary-filter,
.summary-filter:link,
.summary-filter:visited {
    text-decoration: none;
    color: inherit;
}

.summary-filter strong,
.summary-filter span {
    text-decoration: none;
}

.summary-filter:hover {
    text-decoration: none;
}
