:root {
    --mah-primary: #0f766e;
    --mah-primary-dark: #115e59;
    --mah-bg: #f5f7fb;
    --mah-sidebar: #102a43;
    --mah-border: #e2e8f0;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--mah-bg); color: #1e293b; }
a { color: var(--mah-primary); }
.mah-app { min-height: 100vh; }
.mah-sidebar { background: var(--mah-sidebar); color: #dbeafe; min-height: 100vh; }
.mah-sidebar .brand { color: #fff; letter-spacing: .02em; }
.mah-sidebar .brand small { color: #93c5fd; }
.mah-sidebar .nav-link { color: #cbd5e1; border-radius: .6rem; padding: .7rem .85rem; }
.mah-sidebar .nav-link:hover, .mah-sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.mah-sidebar .nav-link .bi { width: 1.25rem; }
.mah-topbar { background: #fff; border-bottom: 1px solid var(--mah-border); }
.mah-content { max-width: 1500px; }
.mah-page-title { font-weight: 700; letter-spacing: -.02em; }
.mah-card, .card { border: 1px solid var(--mah-border); border-radius: .85rem; box-shadow: 0 .15rem .8rem rgba(15, 23, 42, .04); }
.mah-card, .card { transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
a.card:hover { border-color: #99f6e4; box-shadow: 0 .55rem 1.4rem rgba(15, 118, 110, .12); transform: translateY(-2px); }
.card h2, .card h3 { color: #0f172a; }
.mah-card .card-header { background: transparent; border-bottom-color: var(--mah-border); }
.mah-stat { border-left: .25rem solid var(--mah-primary); }
.mah-stat .value { font-size: 1.65rem; font-weight: 700; }
.mah-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mah-muted { color: #64748b; }
.mah-table thead th { color: #64748b; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.mah-table tbody tr:hover { background: #f8fafc; }
.mah-empty { border: 1px dashed #cbd5e1; background: #fff; }
.mah-map { height: 55vh; min-height: 320px; }
.btn-primary { --bs-btn-bg: var(--mah-primary); --bs-btn-border-color: var(--mah-primary); --bs-btn-hover-bg: var(--mah-primary-dark); --bs-btn-hover-border-color: var(--mah-primary-dark); }
.text-primary { color: var(--mah-primary) !important; }
.bg-primary { background-color: var(--mah-primary) !important; }
.status-dot { width: .55rem; height: .55rem; display: inline-block; border-radius: 50%; background: #22c55e; }
.status-dot.paused { background: #f59e0b; }
.status-dot.closed { background: #94a3b8; }
.button, button:not(.btn), input[type=submit]:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: .65rem 1rem;
    border: 1px solid var(--mah-primary);
    border-radius: .55rem;
    background: var(--mah-primary);
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.button:hover, button:not(.btn):hover, input[type=submit]:not(.btn):hover { background: var(--mah-primary-dark); border-color: var(--mah-primary-dark); color: #fff; transform: translateY(-1px); }
button.danger, .button.danger { background: #b42318; border-color: #b42318; }
.button.secondary, button.secondary { background: #fff; border-color: #cbd5e1; color: #334155; }
.button.secondary:hover, button.secondary:hover { background: #f8fafc; border-color: #94a3b8; color: #0f172a; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); }
.cards > .card { height: 100%; }
.badge.Pending { background: #fef3c7; color: #92400e; }
.badge.Delivered { background: #dcfce7; color: #166534; }
.badge.Cancelled { background: #fee2e2; color: #991b1b; }
.table-scroll { overflow-x: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions form { margin: 0; }
form label { color: #334155; font-weight: 500; }
form input, form textarea, form select { border-color: #cbd5e1; border-radius: .55rem; }
form input:focus, form textarea:focus, form select:focus { border-color: var(--mah-primary); box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15); outline: 0; }
[role=alert]:not(.alert) { padding: .85rem 1rem; border: 1px solid #fecaca; border-radius: .55rem; background: #fef2f2; color: #991b1b; margin-bottom: 1rem; }
[role=status]:not(.alert) { padding: .85rem 1rem; border: 1px solid #a7f3d0; border-radius: .55rem; background: #ecfdf5; color: #065f46; margin-bottom: 1rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (min-width: 992px) {
    .mah-sidebar { position: sticky; top: 0; height: 100vh; }
}

@media (max-width: 991.98px) {
    .mah-sidebar { min-height: auto; }
    .mah-sidebar .nav { flex-direction: row !important; }
    .mah-sidebar .nav-link { padding: .55rem .7rem; }
}

@media (max-width: 575.98px) {
    .mah-actions > .btn, .mah-actions > form, .mah-actions > form .btn { width: 100%; }
    .mah-actions > form .btn { display: flex; }
    .mah-map { height: 60vh; min-height: 280px; }
}
