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

/* ── Base ─────────────────────────────────────────────────────── */
.mt-wrap { font-family:'Inter',sans-serif; color:#1a1a2e; font-size:14px; }
.mt-wrap * { box-sizing:border-box; }

/* ── Layout: sidebar + content ───────────────────────────────── */
.mt-layout {
    display:flex;
    min-height:100vh;
    background:#f0f4f8;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.mt-sidebar {
    width:220px;
    min-width:220px;
    background:linear-gradient(160deg,#0077b6,#0096c7);
    color:#fff;
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0; left:0; bottom:0;
    z-index:100;
    box-shadow:2px 0 12px rgba(0,0,0,.15);
}
.mt-sidebar-brand {
    padding:22px 20px 16px;
    border-bottom:1px solid rgba(255,255,255,.15);
}
.mt-sidebar-brand .mt-brand-icon { font-size:24px; margin-bottom:6px; }
.mt-sidebar-brand h3 {
    margin:0; font-size:14px; font-weight:600;
    color:#fff; line-height:1.3;
}
.mt-sidebar-brand p {
    margin:3px 0 0; font-size:11px;
    color:rgba(255,255,255,.65);
}
.mt-sidebar-user {
    padding:14px 20px;
    border-bottom:1px solid rgba(255,255,255,.12);
}
.mt-sidebar-user .mt-uname {
    font-size:13px; font-weight:500; color:#fff;
}
.mt-sidebar-user .mt-urole {
    font-size:11px; color:rgba(255,255,255,.6);
    background:rgba(255,255,255,.12);
    padding:2px 8px; border-radius:20px;
    display:inline-block; margin-top:4px;
}
.mt-sidebar-nav {
    flex:1; padding:10px 0; overflow-y:auto;
}
.mt-sidebar-nav a {
    display:flex; align-items:center; gap:10px;
    padding:10px 20px;
    color:rgba(255,255,255,.8);
    text-decoration:none;
    font-size:13.5px;
    transition:background .15s, color .15s;
    border-left:3px solid transparent;
}
.mt-sidebar-nav a:hover {
    background:rgba(255,255,255,.12);
    color:#fff;
}
.mt-sidebar-nav a.active {
    background:rgba(255,255,255,.18);
    color:#fff;
    border-left-color:#fff;
    font-weight:500;
}
.mt-sidebar-nav .nav-icon { font-size:16px; width:20px; text-align:center; }
.mt-sidebar-logout {
    padding:14px 20px;
    border-top:1px solid rgba(255,255,255,.12);
}
.mt-sidebar-logout a {
    display:flex; align-items:center; gap:8px;
    color:rgba(255,255,255,.7);
    text-decoration:none; font-size:20px!important;
    padding:8px 12px; border-radius:6px;
    transition:background .15s;
   
}
.mt-sidebar-logout a:hover { background:rgba(255,255,255,.12); color:#fff; }

/* ── Main content area ───────────────────────────────────────── */
.mt-main {
    margin-left:220px;
    flex:1;
    display:flex;
    flex-direction:column;
    min-height:100vh;
}
.mt-header {
    background:#fff;
    border-bottom:1px solid #dde3ec;
    padding:14px 28px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    position:sticky; top:0; z-index:50;
}
.mt-header h1 {
    margin:0; font-size:18px; font-weight:600; color:#1a1a2e;
}
.mt-content { padding:24px 28px; flex:1; }

/* ── Cards ───────────────────────────────────────────────────── */
.mt-card {
    background:#fff;
    border:1px solid #dde3ec;
    border-radius:10px;
    padding:20px 22px;
    margin-bottom:16px;
}
.mt-card-title {
    font-size:15px; font-weight:600;
    margin-bottom:16px; padding-bottom:10px;
    border-bottom:1px solid #eef1f7;
    color:#1a1a2e;
}

/* ── Stat cards ──────────────────────────────────────────────── */
.mt-stat-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.mt-stat-card {
    background:#fff; border-radius:10px;
    padding:16px 20px; flex:1; min-width:120px;
    border-top:3px solid #0096c7;
    border:1px solid #dde3ec;
    border-top:3px solid #0096c7;
}
.mt-stat-card.blue   { border-top-color:#0096c7; }
.mt-stat-card.teal   { border-top-color:#00b4d8; }
.mt-stat-card.amber  { border-top-color:#f4a261; }
.mt-stat-card.red    { border-top-color:#e63946; }
.mt-stat-card.green  { border-top-color:#2dc653; }
.mt-stat-val { font-size:28px; font-weight:600; color:#1a1a2e; line-height:1.1; }
.mt-stat-lbl { font-size:11px; color:#292a2c; text-transform:uppercase; letter-spacing:.05em; margin-top:4px; }

/* ── Topbar ──────────────────────────────────────────────────── */
.mt-topbar {
    display:flex; align-items:center;
    justify-content:space-between;
    margin-bottom:16px; gap:12px; flex-wrap:wrap;
}
.mt-page-title { font-size:18px; font-weight:600; color:#1a1a2e; margin:0; }

/* ── Buttons ─────────────────────────────────────────────────── */
.mt-btn {
    display:inline-flex; align-items:center; gap:6px;
    padding:8px 16px; border-radius:6px;
    font-family:'Inter',sans-serif; font-size:13px;
    font-weight:500; cursor:pointer;
    text-decoration:none; border:none;
    transition:all .15s; line-height:1.4;
}
.mt-btn-primary { background:#0077b6; color:#fff; }
.mt-btn-primary:hover { background:#005f92; color:#fff; }
.mt-btn-secondary { background:#f0f4f8; color:#1a1a2e; border:1px solid #dde3ec; }
.mt-btn-secondary:hover { background:#e2e8f0; }
.mt-btn-sm { padding:5px 12px; font-size:12px; border-radius:5px; }
.mt-btn-full { width:100%; justify-content:center; padding:11px; }

/* ── Forms ───────────────────────────────────────────────────── */
.mt-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px 18px; }
.mt-full { grid-column:1/-1; }
.mt-field { display:flex; flex-direction:column; gap:5px; }
.mt-field label {
    font-size:14px; font-weight:600;
    letter-spacing:.06em; text-transform:uppercase; color:#2f4168;
}
.mt-field input,
.mt-field select,
.mt-field textarea {
    padding:9px 12px;
    border:1px solid #b2b7bf;
    border-radius:6px;
    font-family:'Inter',sans-serif;
    font-size:14px; color:#1a1a2e;
    background:#f8fafc;
    outline:none;
    transition:border-color .18s, background .18s;
    width:100%;
}
.mt-field input:focus,
.mt-field select:focus,
.mt-field textarea:focus {
    border-color:#0077b6; background:#fff;
    box-shadow:0 0 0 3px rgba(0,119,182,.1);
}
.mt-field textarea { resize:vertical; min-height:72px; }
.mt-pw-wrap { position:relative; }
.mt-pw-wrap input { padding-right:40px; }
.mt-pw-btn {
    position:absolute; right:10px; top:50%;
    transform:translateY(-50%);
    background:none; border:none; cursor:pointer;
    color:#6b7a9a; font-size:14px;
}

/* ── Filter bar ──────────────────────────────────────────────── */
.mt-filter-form {
    background:#f8fafc; padding:14px 16px;
    border-radius:8px; border:1px solid #dde3ec;
    margin-bottom:14px;
}
.mt-filter-row {
    display:flex; flex-wrap:wrap; gap:8px; align-items:center;
}
.mt-filter-row input,
.mt-filter-row select {
    padding:7px 10px; border:1px solid #dde3ec;
    border-radius:6px; font-size:13px;
    background:#fff; color:#1a1a2e;
    font-family:'Inter',sans-serif;
}

/* ── Table ───────────────────────────────────────────────────── */
.mt-table-wrap { overflow-x:auto; border-radius:8px; border:1px solid #dde3ec; }
.mt-table { width:100%; border-collapse:collapse; font-size:13px; }
.mt-table thead th {
    background:#f0f4f8; padding:10px 14px;
    text-align:left; font-size:11px;
    font-weight:600; letter-spacing:.05em;
    text-transform:uppercase; color:#6b7a9a;
    border-bottom:2px solid #dde3ec;
    white-space:nowrap;
}
.mt-table tbody tr { border-bottom:1px solid #f0f4f8; }
.mt-table tbody tr:hover { background:#f8fafc; }
.mt-table tbody tr:last-child { border-bottom:none; }
.mt-table tbody td { padding:10px 14px; vertical-align:top; }

/* ── Badges ──────────────────────────────────────────────────── */
.mt-count-badge {
    display:inline-block; background:#0077b6;
    color:#fff; font-size:10px; padding:1px 7px;
    border-radius:20px; margin-left:5px; vertical-align:middle;
}
.mt-status-badge {
    font-size:11px; padding:3px 10px;
    border-radius:20px; font-weight:500;
}
.mt-status-badge.done    { background:#d1fae5; color:#065f46; }
.mt-status-badge.pending { background:#fee2e2; color:#991b1b; }
.mt-role-badge {
    font-size:11px; background:rgba(255,255,255,.2);
    color:#fff; padding:2px 8px; border-radius:20px;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.mt-tabs {
    display:flex; border-bottom:2px solid #dde3ec;
    margin-bottom:16px; gap:0; flex-wrap:wrap;
}
.mt-tab {
    padding:10px 18px; font-size:13.5px; font-weight:500;
    color:#6b7a9a; text-decoration:none;
    border-bottom:2px solid transparent;
    margin-bottom:-2px; transition:color .15s;
    white-space:nowrap;
}
.mt-tab:hover { color:#1a1a2e; }
.mt-tab.active { color:#0077b6; border-bottom-color:#0077b6; }

/* ── Pagination ──────────────────────────────────────────────── */
.mt-pagination { display:flex; gap:4px; margin-top:14px; flex-wrap:wrap; }
.mt-page-btn {
    padding:5px 12px; border:1px solid #dde3ec;
    border-radius:5px; font-size:13px; color:#1a1a2e;
    text-decoration:none; transition:background .12s;
}
.mt-page-btn:hover { background:#f0f4f8; }
.mt-page-btn.active { background:#0077b6; color:#fff; border-color:#0077b6; }
.mt-total { font-size:12px; color:#6b7a9a; margin-top:8px; }
.mt-empty { padding:40px; text-align:center; color:#6b7a9a; font-size:14px; }

/* ── Notice ──────────────────────────────────────────────────── */
.mt-notice-success {
    background:#d1fae5; border-left:3px solid #059669;
    color:#065f46; padding:10px 14px;
    margin-bottom:14px; border-radius:0 6px 6px 0; font-size:13.5px;
}
.mt-notice-error {
    background:#fee2e2; border-left:3px solid #dc2626;
    color:#991b1b; padding:10px 14px;
    margin-bottom:14px; border-radius:0 6px 6px 0; font-size:13.5px;
}

/* ── Login page ──────────────────────────────────────────────── */
.mt-login-page {
    min-height:100vh; background:linear-gradient(135deg,#0077b6,#00b4d8);
    display:flex; align-items:center; justify-content:center;
    padding:20px;
}
.mt-login-box {
    background:#fff; border-radius:14px;
    width:100%; max-width:420px;
    overflow:hidden;
    box-shadow:0 20px 60px rgba(0,0,0,.2);
}
.mt-login-header {
    background:linear-gradient(135deg,#0077b6,#00b4d8);
    padding:32px; text-align:center; color:#fff;
}
.mt-login-header .icon { font-size:40px; margin-bottom:10px; }
.mt-login-header h2 { margin:0; font-size:22px; font-weight:600; }
.mt-login-header p  { margin:6px 0 0; font-size:13px; opacity:.8; }
.mt-login-body { padding:28px 32px; }

/* ── Tab nav + buttons (used in records, forward, dispatch pages) */
.mt-tab-nav {
    display:flex;
    flex-wrap:wrap;
    gap:4px;
    border-bottom:2px solid #dde3ec;
    margin-bottom:16px;
    padding-bottom:0;
}
.mt-tab-btn {
    padding:9px 16px;
    font-size:13px;
    font-weight:500;
    color:#6b7a9a;
    background:transparent;
    border:none;
    border-bottom:2px solid transparent;
    margin-bottom:-2px;
    cursor:pointer;
    font-family:'Inter',sans-serif;
    border-radius:6px 6px 0 0;
    transition:color .15s, background .15s, border-color .15s;
    white-space:nowrap;
}
.mt-tab-btn:hover {
    color:#1a1a2e;
    background:rgba(0,119,182,.06);
}
.mt-tab-btn.active {
    color:#0077b6;
    border-bottom-color:#0077b6;
    font-weight:600;
    background:rgba(0,119,182,.08);
}
.mt-tab-pane { display:none; }
.mt-tab-pane.active { display:block; }

/* ── Page header ─────────────────────────────────────────────── */
.mt-page-header { margin-bottom:20px; }
.mt-page-header h2 { margin:0 0 4px; font-size:20px; font-weight:600; color:#1a1a2e; }
.mt-page-header p  { margin:0; font-size:13px; color:#6b7a9a; }

/* ── Stat card num (override inline for colour support) ────── */
.mt-stat-num { font-size:26px; font-weight:700; color:#1a1a2e; line-height:1.1; }
.mt-stat-label { font-size:11px; color:#6b7a9a; margin-top:4px; text-transform:uppercase; letter-spacing:.04em; }

/* ── Pagination controls ─────────────────────────────────────── */
.mt-pg-ctrl {
    display:flex; align-items:center; gap:6px;
    margin-top:12px; flex-wrap:wrap;
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
    .mt-sidebar, .mt-header, .mt-filter-form,
    .mt-topbar .mt-btn, .mt-pagination,
    .mt-total, .mt-no-print { display:none !important; }
    .mt-main { margin-left:0; }
    .mt-print-title { display:block !important; font-size:16px; font-weight:600; margin-bottom:10px; }
    .mt-table { font-size:11px; }
    .mt-table thead th { background:#eee !important; -webkit-print-color-adjust:exact; }
}
.mt-print-title { display:none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width:1024px) {
    .mt-content { padding:20px 18px; }
}
@media (max-width:768px) {
    .mt-sidebar {
        width:100%; min-width:unset; height:auto;
        position:relative; flex-direction:column;
    }
    .mt-sidebar-nav { display:flex; flex-wrap:wrap; padding:6px; }
    .mt-sidebar-nav a { padding:8px 12px; border-left:none; border-radius:6px; font-size:12px; }
    .mt-main { margin-left:0; }
    .mt-layout { flex-direction:column; }
    .mt-form-grid { grid-template-columns:1fr; }
    .mt-full { grid-column:1; }
    .mt-content { padding:14px 12px; }
    .mt-header { padding:10px 14px; }
    .mt-card { padding:14px 14px; margin-bottom:12px; }
    .mt-stat-card { padding:12px 14px; }
    .mt-stat-num { font-size:22px; }
    .mt-stat-row { gap:8px; }
    .mt-stat-card { min-width:calc(50% - 4px); }
    .mt-table thead th, .mt-table tbody td { padding:8px 10px; font-size:12px; }
    .mt-tab-btn { padding:7px 12px; font-size:12px; }
    .mt-page-header h2 { font-size:17px; }
}
@media (max-width:480px) {
    .mt-content { padding:10px 8px; }
    .mt-card { padding:12px 10px; margin-bottom:10px; }
    .mt-stat-card { min-width:calc(50% - 6px); padding:10px 10px; }
    .mt-stat-num { font-size:20px; }
    .mt-stat-label { font-size:10px; }
    .mt-tab-btn { padding:6px 10px; font-size:11.5px; }
    .mt-tab-nav { gap:2px; }
    .mt-table thead th, .mt-table tbody td { padding:7px 8px; font-size:11px; }
    .mt-btn { padding:7px 12px; font-size:12px; }
}
