﻿@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root{
    --bg:#f0f4fa;
    --panel:#ffffff;
    --panel-soft:#f7f9fc;
    --text:#1a2235;
    --muted:#64748b;
    --line:#e2e8f0;
    --primary:#1d5fcc;
    --primary-dark:#1549a8;
    --primary-light:#3b7de8;
    --primary-glow:rgba(29,95,204,.14);
    --accent:#06b6d4;
    --danger:#e53e3e;
    --warning:#d97706;
    --success:#059669;
    --sidebar-a:#0f2040;
    --sidebar-b:#162d5a;
    --sidebar-hover:rgba(255,255,255,.10);
    --sidebar-active-bg:rgba(255,255,255,.15);
    --shadow:0 8px 32px rgba(15,23,42,.10);
    --shadow-sm:0 2px 10px rgba(15,23,42,.07);
    --radius:14px;
    --radius-sm:9px;
    --radius-xs:6px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{min-height:100%;scroll-behavior:smooth}
body{
    min-height:100vh;
    font-family:'Sarabun','Segoe UI',Tahoma,sans-serif;
    color:var(--text);
    background:var(--bg);
    line-height:1.65;
    font-size:15px;
    overflow-x:hidden;
}

/* LINKS */
a{color:var(--primary);text-decoration:none;font-weight:500}
a:hover{text-decoration:underline;color:var(--primary-dark)}
a,button,input[type='submit'],input[type='button'],label{-webkit-tap-highlight-color:transparent}
img{max-width:100%;vertical-align:middle}
button,input[type='submit'],input[type='button']{touch-action:manipulation}

/* HEADINGS */
h1{
    margin:0 0 20px;
    color:var(--text);
    font-size:1.7rem;
    font-weight:700;
    letter-spacing:-.02em;
    line-height:1.25;
}
h2{font-size:1.05rem;margin:20px 0 10px;color:var(--text);font-weight:600}

/* AUTH LAYOUT */
.auth-body{
    background:linear-gradient(135deg,#0f2040 0%,#1d5fcc 60%,#06b6d4 100%);
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px 16px;
}
.auth-wrap{
    width:100%;
    max-width:420px;
    display:flex;
    flex-direction:column;
    gap:20px;
}
.auth-brand{text-align:center;color:#fff}
.auth-logo{
    width:64px;
    height:64px;
    border-radius:50%;
    background:rgba(255,255,255,.18);
    border:2px solid rgba(255,255,255,.35);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
    margin:0 auto 12px;
}
.auth-brand h2{color:#fff;font-size:1.25rem;font-weight:700;margin:0 0 4px}
.auth-brand p{color:rgba(255,255,255,.72);font-size:13.5px;margin:0}

/* PAGE (centered forms) */
.page{
    max-width:700px;
    margin:0 auto;
    padding:52px 20px;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    justify-content:center;
}
.page.compact{max-width:440px}

/* PANELS & CARDS */
.panel,.content-card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}
.panel{
    padding:36px 40px;
    position:relative;
    overflow:hidden;
}
.panel::before{
    content:'';
    position:absolute;
    top:0;left:0;right:0;
    height:4px;
    background:linear-gradient(90deg,var(--primary),var(--accent));
}
.content-card{
    margin:20px 24px;
    padding:28px 32px;
    overflow:auto;
}

/* FORMS */
.form{display:grid;gap:18px}
.form label,.filter-bar label,.vehicle-row label{
    display:grid;
    gap:6px;
    font-size:12.5px;
    color:var(--muted);
    font-weight:600;
    letter-spacing:.04em;
    text-transform:uppercase;
}
.form span{color:var(--danger)}

input,select{
    width:100%;
    min-height:42px;
    border:1.5px solid var(--line);
    border-radius:var(--radius-sm);
    padding:9px 13px;
    font-size:15px;
    font-family:inherit;
    color:var(--text);
    background:var(--panel-soft);
    transition:border-color .18s,box-shadow .18s,background .18s;
    -webkit-appearance:none;
}
input:focus,select:focus{
    outline:none;
    border-color:var(--primary);
    background:var(--panel);
    box-shadow:0 0 0 3px var(--primary-glow);
}
input:disabled{background:#f1f5f9;color:var(--muted);cursor:not-allowed}

/* BUTTONS */
.actions{
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:8px;
    flex-wrap:wrap;
}
button,.btn-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:40px;
    border-radius:var(--radius-sm);
    font-size:14px;
    font-family:inherit;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;
    white-space:nowrap;
    padding:9px 20px;
    letter-spacing:.01em;
}
button{
    border:0;
    background:linear-gradient(135deg,var(--primary),var(--primary-light));
    color:#fff;
    box-shadow:0 4px 12px rgba(29,95,204,.28);
}
button:hover{
    transform:translateY(-1px);
    box-shadow:0 6px 18px rgba(29,95,204,.38);
}
button:active{transform:translateY(0)}
.ghost{
    margin-left:auto;
    background:transparent;
    color:var(--muted);
    border:1.5px solid var(--line);
    box-shadow:none;
}
.ghost:hover{background:var(--panel-soft);border-color:#c0ccd8;box-shadow:none;transform:none}
.btn-link{
    border:1.5px solid var(--line);
    padding:8px 16px;
    background:var(--panel);
    color:var(--primary);
}
.btn-link:hover{background:var(--panel-soft);border-color:var(--primary);text-decoration:none}
.logout{color:var(--danger)}
.logout:hover{background:#fff5f5;border-color:#fca5a5;color:var(--danger)}

/* ALERTS */
.alert{
    border-radius:var(--radius-sm);
    padding:13px 16px;
    margin-bottom:20px;
    border:1.5px solid transparent;
    display:flex;
    flex-direction:column;
    gap:2px;
}
.alert p{margin:2px 0;font-size:14px}
.alert.error{background:#fff5f5;color:#b91c1c;border-color:#fecaca}
.alert.ok{background:#f0fdf4;color:#166534;border-color:#bbf7d0}

/* APP SHELL */
.app-shell{
    display:grid;
    grid-template-columns:260px minmax(0,1fr);
    min-height:100vh;
}

/* SIDEBAR */
.sidebar{
    background:linear-gradient(180deg,var(--sidebar-a) 0%,var(--sidebar-b) 100%);
    padding:0 0 16px;
    position:sticky;
    top:0;
    height:100vh;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    box-shadow:4px 0 24px rgba(0,0,0,.18);
}
.sidebar-brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:20px 18px 18px;
    border-bottom:1px solid rgba(255,255,255,.10);
    margin-bottom:10px;
    flex-shrink:0;
}
.sidebar-brand .brand-icon{
    width:40px;
    height:40px;
    border-radius:10px;
    background:linear-gradient(135deg,var(--primary-light),var(--accent));
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    flex-shrink:0;
    box-shadow:0 4px 10px rgba(0,0,0,.2);
}
.sidebar-brand .brand-text{
    color:#fff;
    font-size:14px;
    font-weight:700;
    line-height:1.3;
}
.sidebar-brand .brand-sub{
    color:rgba(255,255,255,.55);
    font-size:11.5px;
    font-weight:400;
    display:block;
    margin-top:1px;
}

.nav{
    display:flex;
    align-items:center;
    gap:9px;
    margin:2px 10px;
    padding:10px 14px;
    color:rgba(255,255,255,.72);
    text-decoration:none;
    font-weight:500;
    border-radius:var(--radius-sm);
    border:1px solid transparent;
    font-size:14px;
    transition:all .18s ease;
}
.nav:hover{background:var(--sidebar-hover);color:#fff;text-decoration:none}
.nav.active{
    background:var(--sidebar-active-bg);
    color:#fff;
    border-color:rgba(255,255,255,.18);
    font-weight:600;
    box-shadow:0 4px 14px rgba(0,0,0,.18);
}
.nav-icon{font-size:15px;width:20px;text-align:center;opacity:.85;flex-shrink:0}
.nav.active .nav-icon{opacity:1}
.nav-logout{margin-top:auto;color:#fca5a5}
.nav-logout:hover{background:rgba(239,68,68,.15);color:#fca5a5}

/* TOPBAR */
.topbar{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
    padding-bottom:18px;
    border-bottom:2px solid var(--line);
}
.topbar h1{margin-bottom:0}
.top-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

/* PROFILE SUMMARY */
.summary-grid{
    display:grid;
    grid-template-columns:190px minmax(0,1fr);
    gap:28px;
    align-items:start;
}
.photo-box{
    width:170px;
    min-height:210px;
    background:linear-gradient(135deg,#e8f0fe,#dbeafe);
    border:2px solid var(--line);
    border-radius:var(--radius);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    box-shadow:var(--shadow-sm);
}
.photo-box.large{width:210px;min-height:260px}
.photo-box img{width:100%;height:100%;object-fit:cover}
.photo-empty{color:var(--muted);font-weight:600;font-size:13px}

.profile{
    display:grid;
    grid-template-columns:150px minmax(0,1fr);
    gap:0;
    margin:0;
    border:1.5px solid var(--line);
    border-radius:var(--radius-sm);
    overflow:hidden;
}
.profile.wide{grid-template-columns:165px minmax(0,1fr)}
.profile dt{
    font-weight:600;
    color:var(--muted);
    font-size:13px;
    padding:10px 14px;
    background:var(--panel-soft);
    border-bottom:1px solid var(--line);
}
.profile dt:last-of-type{border-bottom:0}
.profile dd{
    margin:0;
    color:var(--text);
    word-break:break-word;
    padding:10px 14px;
    border-bottom:1px solid var(--line);
}
.profile dd:last-child{border-bottom:0}

/* EDIT GRID */
.edit-grid{
    display:grid;
    grid-template-columns:250px minmax(0,1fr);
    gap:28px;
    align-items:start;
}
.photo-panel{
    border:1.5px solid var(--line);
    border-radius:var(--radius);
    padding:20px;
    background:var(--panel-soft);
    text-align:center;
}
.upload-label{
    display:grid;
    gap:8px;
    margin-top:14px;
    font-weight:600;
    font-size:12.5px;
    text-align:left;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:.04em;
}
.hint,.muted{color:var(--muted);font-size:13px;line-height:1.6}

/* TABLES */
.table-wrap{
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    border:1.5px solid var(--line);
    border-radius:var(--radius);
    background:var(--panel);
    box-shadow:var(--shadow-sm);
}
table{width:100%;border-collapse:separate;border-spacing:0}
th,td{
    border-bottom:1px solid var(--line);
    padding:12px 14px;
    text-align:left;
    font-size:14px;
}
th{
    position:sticky;
    top:0;z-index:1;
    background:linear-gradient(180deg,#f8fafc,#f0f4f8);
    color:var(--muted);
    font-weight:700;
    font-size:11.5px;
    text-transform:uppercase;
    letter-spacing:.06em;
}
tbody tr{transition:background .15s}
tbody tr:hover td{background:#f0f7ff}
tbody tr:last-child td{border-bottom:0}

/* VEHICLES */
.vehicle-panel{margin-top:28px;border-top:2px solid var(--line);padding-top:24px}
.vehicle-panel.standalone{border-top:0;margin-top:0;padding-top:0}
.section-title{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
    margin-bottom:16px;
}
.section-title h2{margin:0;color:var(--text)}
.section-title p{margin:0;color:var(--muted);font-size:13px}
.vehicle-list{display:grid;gap:14px}
.vehicle-row{
    display:grid;
    grid-template-columns:1.05fr 1.2fr .8fr .9fr .9fr auto;
    gap:12px;
    align-items:end;
    border:1.5px solid var(--line);
    border-radius:var(--radius);
    padding:16px;
    background:var(--panel-soft);
    transition:border-color .18s,box-shadow .18s;
}
.vehicle-row:hover{
    border-color:var(--primary);
    box-shadow:0 0 0 3px var(--primary-glow);
}
.vehicle-row input,.vehicle-row select{min-height:40px}
.delete-check{
    display:flex!important;
    align-items:center;
    gap:6px;
    min-width:70px;
    padding-bottom:8px;
    text-transform:none!important;
    letter-spacing:0!important;
    font-size:14px!important;
    color:var(--danger)!important;
}
.delete-check input{width:auto;min-height:auto}
.new-badge{
    align-self:center;
    color:var(--success);
    background:#ecfdf5;
    border:1.5px solid #a7f3d0;
    border-radius:999px;
    padding:6px 12px;
    font-size:12px;
    font-weight:700;
    text-align:center;
    letter-spacing:.02em;
}
.sticky-actions{border-top:2px solid var(--line);padding-top:18px;margin-top:4px}

/* FILTER BAR */
.filter-bar{
    display:grid;
    grid-template-columns:1.4fr 1fr auto;
    gap:14px;
    align-items:end;
    margin:8px 0 16px;
    padding:16px 18px;
    border:1.5px solid var(--line);
    border-radius:var(--radius);
    background:var(--panel-soft);
}
.filter-actions{display:flex;gap:8px;align-items:center}

/* DIRECTORY TABLE */
.directory-table{margin-top:14px}
.directory-table th,.directory-table td{white-space:nowrap;vertical-align:middle}
.directory-table td:first-child,.directory-table th:first-child{text-align:center}
.contact-thumb{
    width:52px;
    height:66px;
    object-fit:cover;
    border:2px solid var(--line);
    border-radius:8px;
    background:#eef2f6;
    display:block;
    transition:transform .2s;
}
.contact-thumb:hover{transform:scale(1.05)}
.thumb-empty{
    display:flex;
    align-items:center;
    justify-content:center;
    width:52px;
    height:66px;
    border:2px solid var(--line);
    border-radius:8px;
    background:var(--panel-soft);
    color:var(--muted);
    font-size:10.5px;
    font-weight:700;
    text-align:center;
}

/* CONTACTS FILTER BAR */
.contacts-filter{
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:10px;
    align-items:center;
    margin-bottom:20px;
    padding:14px 16px;
    background:var(--panel-soft);
    border:1.5px solid var(--line);
    border-radius:var(--radius);
}
.cf-search{
    position:relative;
    display:flex;
    align-items:center;
}
.cf-icon{
    position:absolute;
    left:12px;
    font-size:15px;
    pointer-events:none;
    line-height:1;
}
.cf-search input{
    padding-left:36px;
    min-height:44px;
    font-size:15px;
}
.cf-select{
    min-height:44px;
    font-size:14px;
    min-width:180px;
}
.cf-actions{display:flex;gap:8px;align-items:center;flex-shrink:0}
.cf-actions button{min-height:44px;padding:0 20px}
.cf-actions .btn-link{min-height:44px}

/* CONTACT CARDS GRID */
.contact-cards{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
    gap:14px;
}
.contact-card{
    display:flex;
    gap:14px;
    align-items:flex-start;
    background:var(--panel);
    border:1.5px solid var(--line);
    border-radius:var(--radius);
    padding:16px;
    transition:border-color .18s,box-shadow .18s,transform .18s;
}
@media(hover:hover){
    .contact-card:hover{
        border-color:var(--primary);
        box-shadow:0 4px 20px var(--primary-glow);
        transform:translateY(-2px);
    }
}
.cc-photo{
    flex-shrink:0;
    width:64px;
    height:80px;
    border-radius:10px;
    overflow:hidden;
    background:linear-gradient(135deg,#e8f0fe,#dbeafe);
    border:2px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:center;
}
.cc-photo img{width:100%;height:100%;object-fit:cover;display:block}
.cc-img-zoomable{cursor:zoom-in;transition:opacity .15s}
.cc-img-zoomable:hover{opacity:.88}
.cc-initials{
    font-size:20px;
    font-weight:700;
    color:var(--primary);
    letter-spacing:-.02em;
}
.cc-body{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:8px;
}
.cc-name{
    font-size:15.5px;
    font-weight:700;
    color:var(--text);
    line-height:1.3;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.cc-meta{display:flex;flex-wrap:wrap;gap:5px}
.cc-tag{
    display:inline-block;
    font-size:11.5px;
    font-weight:600;
    padding:2px 8px;
    border-radius:999px;
    line-height:1.6;
    white-space:nowrap;
    max-width:180px;
    overflow:hidden;
    text-overflow:ellipsis;
}
.cc-tag-dept{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.cc-tag-role{background:#f0fdf4;color:#166534;border:1px solid #bbf7d0}
.cc-contacts{display:flex;flex-direction:column;gap:4px}
.cc-contact-item{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:14px;
    line-height:1.4;
    color:var(--text);
    text-decoration:none;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.cc-tel{color:var(--primary);font-weight:600}
.cc-tel:hover{text-decoration:underline}
.cc-email{color:var(--accent)}
.cc-email:hover{text-decoration:underline}
.cc-no-data{color:var(--muted);font-size:13px}
.cc-plates{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding-top:6px;
    border-top:1px solid var(--line);
}
.plate-item{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:5px;
    font-size:13px;
}
.plate-number{
    font-weight:700;
    color:var(--text);
    background:#f0f4fa;
    border:1.5px solid var(--line);
    border-radius:6px;
    padding:2px 8px;
    letter-spacing:.05em;
    white-space:nowrap;
}
.plate-prov{
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
}
.plate-desc{
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* LIGHTBOX */
.lb-overlay{
    position:fixed;
    inset:0;
    z-index:9999;
    background:rgba(10,16,28,.88);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    backdrop-filter:blur(6px);
    animation:lb-in .18s ease;
}
.lb-overlay[hidden]{display:none}
@keyframes lb-in{
    from{opacity:0;transform:scale(.96)}
    to{opacity:1;transform:scale(1)}
}
.lb-content{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
    max-width:min(90vw,520px);
    max-height:90vh;
}
.lb-content img{
    display:block;
    max-width:100%;
    max-height:calc(90vh - 60px);
    border-radius:var(--radius);
    box-shadow:0 24px 60px rgba(0,0,0,.6);
    object-fit:contain;
    animation:lb-img-in .22s ease;
}
@keyframes lb-img-in{
    from{opacity:0;transform:translateY(8px) scale(.97)}
    to{opacity:1;transform:none}
}
.lb-name{
    color:rgba(255,255,255,.9);
    font-size:15px;
    font-weight:600;
    text-align:center;
    text-shadow:0 1px 4px rgba(0,0,0,.5);
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.lb-close{
    position:fixed;
    top:16px;
    right:16px;
    width:40px;
    height:40px;
    border-radius:50%;
    background:rgba(255,255,255,.15);
    border:1.5px solid rgba(255,255,255,.3);
    color:#fff;
    font-size:18px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    transition:background .15s;
    z-index:10000;
    box-shadow:none;
    padding:0;
    min-height:auto;
}
.lb-close:hover{background:rgba(255,255,255,.28);transform:none;box-shadow:none}

/* EMPTY STATE */
.empty-state{
    text-align:center;
    padding:60px 20px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
}
.empty-icon{font-size:48px;line-height:1}
.empty-state p{color:var(--muted);font-size:15px}

/* RESPONSIVE */

/* ── tablet landscape ── */
@media(max-width:1100px){
    .vehicle-row{grid-template-columns:1fr 1fr}
}

/* ── tablet portrait ── */
@media(max-width:900px){
    .filter-bar{grid-template-columns:1fr}
    .filter-actions{align-items:flex-start}
    .contacts-filter{grid-template-columns:1fr 1fr}
    .cf-search{grid-column:1 / -1}
    .contact-cards{grid-template-columns:1fr 1fr}
}

/* ── mobile: sidebar → sticky top bar ── */
@media(max-width:860px){
    .app-shell{grid-template-columns:1fr}
    .sidebar{
        position:sticky;
        top:0;
        height:auto;
        flex-direction:row;
        overflow-x:auto;
        overflow-y:visible;
        padding:4px 8px;
        flex-wrap:nowrap;
        align-items:center;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
        z-index:100;
        box-shadow:0 3px 14px rgba(0,0,0,.22);
    }
    .sidebar::-webkit-scrollbar{display:none}
    .sidebar-brand{
        padding:6px 12px 6px 8px;
        border-bottom:0;
        border-right:1px solid rgba(255,255,255,.15);
        margin-bottom:0;
        margin-right:4px;
        white-space:nowrap;
        flex-shrink:0;
    }
    .sidebar-brand .brand-sub{display:none}
    .sidebar-brand .brand-text{font-size:13px;white-space:nowrap}
    .nav{
        white-space:nowrap;
        margin:0 2px;
        padding:8px 12px;
        min-height:44px;
        font-size:13.5px;
    }
    .nav-logout{margin-top:0}
    .content-card{margin:10px;padding:20px}
    .summary-grid,.edit-grid{grid-template-columns:1fr}
    .photo-box,.photo-box.large{width:100%;max-width:230px}
    .profile,.profile.wide{grid-template-columns:1fr}
    .profile dt{border-bottom:0;padding-bottom:4px}
    .profile dd{border-bottom:1px solid var(--line)}
    .topbar{display:block}
    .top-actions{justify-content:flex-start;margin-top:10px}
    /* prevent iOS Safari auto-zoom on input focus */
    input,select,textarea{font-size:16px}
}

/* ── small phone landscape / large phone portrait ── */
@media(max-width:640px){
    .section-title{display:block}
    .section-title p{margin-top:6px}
    .vehicle-row{grid-template-columns:1fr}
    .delete-check{padding-bottom:0}
    .new-badge{text-align:left}
    .contacts-filter{grid-template-columns:1fr}
    .cf-search{grid-column:auto}
    .cf-select{width:100%;min-width:0}
    .cf-actions{flex-direction:row;flex-wrap:wrap}
    .contact-cards{grid-template-columns:1fr}
    /* larger photo in single-column layout */
    .cc-photo{width:72px;height:90px}
    /* allow text wrapping */
    .cc-name{white-space:normal}
    .cc-contact-item{white-space:normal;word-break:break-all}
}

/* ── phone portrait ── */
@media(max-width:560px){
    .page{padding:24px 14px}
    .panel{padding:22px 18px}
    .content-card{padding:14px 12px}
    h1{font-size:1.35rem}
    .ghost{margin-left:0}
    .auth-body{padding:12px 10px}
    /* stacked action buttons for forms on small screens */
    .actions{flex-direction:column;align-items:stretch}
    .actions button,.actions a,.actions .btn-link{width:100%;justify-content:center;text-align:center}
    .actions .ghost{margin-left:0}
    /* topbar and filter actions */
    .top-actions{gap:6px;flex-wrap:wrap}
    .top-actions .btn-link{flex:1;min-width:100px;justify-content:center}
    .cf-actions{width:100%}
    .cf-actions button,.cf-actions .btn-link{flex:1;justify-content:center}
}

/* ── small phone portrait ── */
@media(max-width:480px){
    .sidebar-brand .brand-text{display:none}
    .sidebar-brand{padding:4px 8px}
    .sidebar-brand .brand-icon{width:32px;height:32px;font-size:16px;border-radius:8px}
    .nav{padding:8px 10px;font-size:13px;gap:6px}
    .content-card{margin:8px;padding:14px 10px}
    .summary-grid{gap:16px}
    .topbar h1{font-size:1.2rem}
    .top-actions .btn-link{padding:6px 10px;font-size:13px}
    .contact-card{padding:12px;gap:10px}
    .cc-photo{width:62px;height:78px}
    .cc-name{font-size:14.5px}
    button,.btn-link{font-size:13.5px}
    /* bigger lightbox close button for thumb */
    .lb-close{width:48px;height:48px;top:12px;right:12px;font-size:20px}
}