/* ===============================
   MODERN DELIVERY PLANNER UI
   =============================== */
:root{
    --bg:#eef3f8;
    --bg-2:#dbeafe;
    --card:#ffffff;
    --card-soft:#f8fafc;
    --text:#0f172a;
    --muted:#64748b;
    --border:#dbe3ee;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --success:#16a34a;
    --danger:#dc2626;
    --shadow:0 18px 45px rgba(15,23,42,.10);
    --radius:18px;
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    padding:18px;
    min-height:100vh;
    font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 32rem),
        linear-gradient(135deg, var(--bg), #f8fbff 42%, var(--bg-2));
    color:var(--text);
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background-image:linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
    background-size:42px 42px;
    mask-image:linear-gradient(to bottom, rgba(0,0,0,.35), transparent 65%);
}

.app-hero{
    position:relative;
    max-width:1180px;
    margin:0 auto 18px;
    padding:28px;
    border-radius:26px;
    color:#fff;
    background:
        linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,64,175,.92)),
        radial-gradient(circle at top right, rgba(59,130,246,.55), transparent 22rem);
    box-shadow:var(--shadow);
    overflow:hidden;
}

.app-hero::after{
    content:"";
    position:absolute;
    right:-60px;
    top:-70px;
    width:220px;
    height:220px;
    border-radius:999px;
    background:rgba(255,255,255,.12);
}

.eyebrow{
    margin:0 0 8px;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.14em;
    color:#bfdbfe;
    font-weight:800;
}

h1{
    position:relative;
    margin:0;
    font-size:clamp(32px, 7vw, 52px);
    line-height:.95;
    letter-spacing:-.05em;
}

.hero-text{
    position:relative;
    max-width:620px;
    margin:14px 0 0;
    color:#dbeafe;
    font-size:15px;
    line-height:1.55;
}

.card{
    position:relative;
    max-width:1180px;
    margin:0 auto 18px;
    padding:22px;
    background:rgba(255,255,255,.88);
    border:1px solid rgba(219,227,238,.85);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    backdrop-filter:blur(14px);
}

.card h2{
    margin:0 0 16px;
    font-size:22px;
    letter-spacing:-.02em;
}

.card h3{
    color:var(--text);
    font-size:16px;
    letter-spacing:-.01em;
}

label{
    display:block;
    margin:12px 0 4px;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

input,
select,
textarea{
    width:100%;
    padding:13px 14px;
    margin:6px 0;
    font-size:15px;
    color:var(--text);
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    outline:none;
    transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

textarea{
    min-height:88px;
    resize:vertical;
}

input:focus,
select:focus,
textarea:focus{
    border-color:rgba(37,99,235,.75);
    box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

button,
.call-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:100%;
    gap:8px;
    min-height:42px;
    padding:11px 14px;
    margin:6px 0;
    border:0;
    border-radius:14px;
    color:#fff;
    background:linear-gradient(135deg, var(--primary), #3b82f6);
    box-shadow:0 10px 22px rgba(37,99,235,.22);
    font-weight:800;
    font-size:14px;
    text-decoration:none;
    cursor:pointer;
    transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button:hover,
.call-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 28px rgba(37,99,235,.28);
    filter:saturate(1.05);
}

button:active,
.call-btn:active{
    transform:translateY(0);
}

button.danger,
.small-btn.danger{
    background:linear-gradient(135deg, var(--danger), #ef4444);
    box-shadow:0 10px 22px rgba(220,38,38,.20);
}

.call-btn{
    width:auto;
    min-height:36px;
    padding:8px 12px;
    margin:0;
    background:linear-gradient(135deg, var(--success), #22c55e);
    box-shadow:0 10px 18px rgba(22,163,74,.18);
    white-space:nowrap;
}

hr{
    border:0;
    height:1px;
    background:linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===============================
   TABLE DESKTOP
   =============================== */
.table-wrapper{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
}

table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    min-width:760px;
    table-layout:fixed;
}

th,
td{
    padding:13px 12px;
    text-align:left;
    vertical-align:middle;
    border-bottom:1px solid var(--border);
    font-size:14px;
}

th{
    position:sticky;
    top:0;
    z-index:1;
    background:#f8fafc;
    color:#475569;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.06em;
    font-weight:900;
}

tr:last-child td{
    border-bottom:0;
}

tbody tr{
    transition:background .15s ease;
}

tbody tr:hover{
    background:#f8fbff;
}

.address,
.comments-col{
    white-space:normal;
    word-break:break-word;
}

.time-col{
    width:112px;
    min-width:112px;
    text-align:center;
}

.time-col input{
    width:96px;
    min-width:96px;
    padding:8px;
    margin:0;
    text-align:center;
}

.actions-cell,
td:last-child{
    min-width:132px;
}

.small-btn,
td:last-child button{
    width:auto;
    min-width:58px;
    min-height:34px;
    padding:7px 10px;
    margin:2px;
    border-radius:10px;
    font-size:12px;
    box-shadow:none;
}

/* ===============================
   AUTOCOMPLETE LIST
   =============================== */
#autocomplete_list{
    position:absolute;
    z-index:1000;
    width:min(620px, calc(100% - 44px));
    max-height:230px;
    overflow-y:auto;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:0 18px 36px rgba(15,23,42,.16);
}

#autocomplete_list div{
    padding:11px 13px;
    cursor:pointer;
    border-bottom:1px solid #eef2f7;
    font-weight:700;
}

#autocomplete_list div:hover{
    background:#eff6ff;
    color:var(--primary-dark);
}

/* ===============================
   MOBILE CARD TABLE
   =============================== */
@media (max-width:768px){
    body{
        padding:12px;
    }

    .app-hero{
        padding:22px;
        border-radius:22px;
    }

    .card{
        padding:16px;
        border-radius:20px;
    }

    input,
    select,
    textarea{
        font-size:16px;
    }

    .table-wrapper{
        border:0;
        background:transparent;
        overflow:visible;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr{
        display:block;
        width:100%;
        min-width:0 !important;
    }

    thead{
        display:none;
    }

    tbody tr{
        margin:0 0 14px;
        padding:14px;
        border:1px solid var(--border);
        border-radius:18px;
        background:#fff;
        box-shadow:0 10px 22px rgba(15,23,42,.08);
    }

    tbody tr:hover{
        background:#fff;
    }

    td{
        display:grid;
        grid-template-columns:92px 1fr;
        gap:10px;
        align-items:center;
        padding:9px 0;
        border:0;
        border-bottom:1px solid #edf2f7;
        white-space:normal;
        font-size:14px;
    }

    td:last-child{
        border-bottom:0;
    }

    td::before{
        content:attr(data-label);
        color:var(--muted);
        font-size:12px;
        font-weight:900;
        text-transform:uppercase;
        letter-spacing:.06em;
    }

    .time-col{
        width:100%;
        min-width:0;
        text-align:left;
    }

    .time-col input{
        width:100%;
        max-width:180px;
    }

    .comments-col,
    .address{
        min-width:0;
    }

    .actions-cell,
    td:last-child{
        min-width:0;
    }

    td[data-label="Actions"]{
        grid-template-columns:1fr;
    }

    td[data-label="Actions"]::before{
        margin-bottom:2px;
    }

    td[data-label="Actions"] button{
        width:100%;
        margin:4px 0;
    }

    .call-btn{
        width:100%;
        max-width:180px;
    }
}

/* ===============================
   COMPANY ACCESS LOCK
   =============================== */
.hidden{
    display:none !important;
}

.access-card{
    text-align:center;
}

.access-card h2{
    margin-bottom:8px;
}

.access-help{
    margin:0 0 14px;
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

.access-card input{
    max-width:360px;
    margin-left:auto;
    margin-right:auto;
    display:block;
    text-align:center;
    font-weight:800;
    letter-spacing:.08em;
}

.access-card button{
    max-width:360px;
    margin-left:auto;
    margin-right:auto;
    display:flex;
}
