/* ============================================================
   3PL WMS — core stylesheet
   Minimal, no framework. Layout is CSS Grid + Flexbox.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    color: #1d2733;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #0654ba; text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------------------- App layout -------------------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
    background: #1b2735;
    color: #f2f4f7;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    flex: 0 0 auto;
}
.app-header .brand {
    color: #fff; font-weight: 700; font-size: 16px; letter-spacing: 0.2px;
}
.app-header .brand-sub { font-weight: 400; opacity: 0.7; margin-left: 6px; font-size: 12px; }
.app-header nav { display: flex; gap: 2px; }
.app-header nav a {
    color: #cfd7e1; padding: 8px 12px; border-radius: 4px;
    font-size: 13px;
}
.app-header nav a:hover { background: #2b3a4d; color: #fff; text-decoration: none; }
.app-header nav a.active { background: #0654ba; color: #fff; }
.app-header .user-block {
    display: flex; align-items: center; gap: 12px; font-size: 13px;
    color: #cfd7e1;
}
.app-header .user-block form { margin: 0; }
.app-header .btn-logout {
    background: transparent; border: 1px solid #3a4a5e; color: #cfd7e1;
    padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.app-header .btn-logout:hover { background: #2b3a4d; color: #fff; }

.app-main {
    flex: 1 1 auto;
    padding: 24px 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    flex: 0 0 auto;
    padding: 12px 20px;
    text-align: center;
    color: #7c8a9c;
    font-size: 12px;
    border-top: 1px solid #e4e9f0;
    background: #fff;
}

/* -------------------- Page headings -------------------- */
.page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dde3ec;
}
.page-header-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 16px; gap: 16px;
}
.page-header-row .page-title { border: 0; margin: 0; padding: 0; }

/* -------------------- Cards -------------------- */
.card {
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-narrow { max-width: 420px; margin: 40px auto; }
.card h2 { margin: 0 0 12px; font-size: 16px; }

/* -------------------- Forms -------------------- */
form .field { margin-bottom: 14px; }
form label {
    display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px;
    color: #33414f;
}
form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form input[type=date],
form select,
form textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #c2cbd6;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
}
form input:focus, form select:focus, form textarea:focus {
    outline: 2px solid #0654ba;
    outline-offset: -1px;
    border-color: #0654ba;
}
form .field-help { font-size: 12px; color: #6b7a8c; margin-top: 2px; }

/* -------------------- Buttons -------------------- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    background: #e4e9f0;
    color: #1d2733;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { background: #d7dee7; text-decoration: none; }
.btn-primary { background: #0654ba; color: #fff; border-color: #0654ba; }
.btn-primary:hover { background: #054a9f; color: #fff; }
.btn-danger  { background: #c4323a; color: #fff; border-color: #c4323a; }
.btn-danger:hover { background: #a82a31; color: #fff; }
.btn-ghost   { background: transparent; border-color: #c2cbd6; }
.btn-sm      { padding: 4px 10px; font-size: 12px; }

/* -------------------- Flash messages -------------------- */
.flash-stack { margin-bottom: 16px; }
.flash {
    padding: 10px 14px; border-radius: 4px; margin-bottom: 8px;
    border-left: 4px solid transparent; font-size: 14px;
}
.flash-success { background: #eaf7ee; border-color: #2ca14d; color: #0f5b25; }
.flash-error   { background: #fdeaea; border-color: #c4323a; color: #7a1c21; }
.flash-info    { background: #e8f1fb; border-color: #0654ba; color: #1b3e72; }
.flash-warning { background: #fff5db; border-color: #c98a00; color: #6b4a00; }

/* -------------------- Tables -------------------- */
table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}
table.data th, table.data td {
    padding: 8px 10px;
    border-bottom: 1px solid #e4e9f0;
    text-align: left;
    vertical-align: top;
}
table.data thead th {
    background: #f4f6f9;
    color: #4a5867;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
table.data tbody tr:hover { background: #fafbfd; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------- Utility -------------------- */
.muted { color: #7c8a9c; }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }

/* -------------------- Login screen -------------------- */
.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: #1b2735;
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 380px; background: #fff;
    border-radius: 8px; padding: 28px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.login-card h1 {
    margin: 0 0 6px; font-size: 20px; text-align: center; color: #1b2735;
}
.login-card .subtitle {
    text-align: center; color: #7c8a9c; font-size: 13px;
    margin-bottom: 22px;
}
.login-card .btn { width: 100%; padding: 10px; }
