/* Vulcan Roastery — Shared Admin Stylesheet (Liquid Glass) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0f2644;
    --navy-lt:    #1a3a5c;
    --navy-dk:    #091a31;
    --amber:      #c8842a;
    --amber-lt:   #e09a3e;
    --bg:         #dce8f5;
    --surface:    rgba(255,255,255,.42);
    --surface-solid: rgba(255,255,255,.55);
    --text:       #1e293b;
    --text-bright:#0f2644;
    --muted:      #64748b;
    --border:     rgba(255,255,255,.55);
    --border-subtle: rgba(255,255,255,.35);
    --success-bg: rgba(22,163,74,.10);
    --success-fg: #15803d;
    --success-bd: rgba(22,163,74,.25);
    --error-bg:   rgba(220,38,38,.08);
    --error-fg:   #b91c1c;
    --error-bd:   rgba(220,38,38,.20);
    --radius:     14px;
    --shadow:     0 4px 16px rgba(15,38,68,.06);
    --shadow-md:  0 8px 32px rgba(15,38,68,.10);
    --glass-blur: 18px;
    --glass-saturate: 1.6;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #c4daf0 0%, #dce8f5 25%, #e8f0fa 50%, #d0e2f4 75%, #b8d4ef 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ── Ambient Background ─────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(200,132,42,.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(15,38,68,.05) 0%, transparent 60%),
        radial-gradient(ellipse 400px 300px at 60% 80%, rgba(59,130,246,.05) 0%, transparent 60%);
    animation: ambientDrift 25s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

@keyframes ambientDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(20px, -15px) rotate(0.5deg); }
    100% { transform: translate(-10px, 10px) rotate(-0.3deg); }
}

/* ── Topbar ──────────────────────────────────── */
.topbar {
    background: rgba(15,38,68,.82);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    height: 60px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(255,255,255,.10);
    box-shadow:
        0 4px 30px rgba(0,0,0,.18),
        inset 0 1px 0 rgba(255,255,255,.08);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-back {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    transition: all .25s;
    backdrop-filter: blur(8px);
}
.topbar-back:hover { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.20); }

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.topbar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,.45);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ── Page Wrapper ────────────────────────────── */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 56px;
    position: relative;
    z-index: 1;
}

/* ── Cards (Liquid Glass) ────────────────────── */
.card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255,255,255,.60);
    position: relative;
    overflow: hidden;
}

/* Glass refraction line on top */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,.65) 20%,
        rgba(255,255,255,.85) 50%,
        rgba(255,255,255,.65) 80%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-bright);
}

.card-body { padding: 22px; }

/* ── Alerts (Glass) ─────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    backdrop-filter: blur(12px);
}
.alert-success {
    background: var(--success-bg);
    color: var(--success-fg);
    border: 1px solid var(--success-bd);
    box-shadow: 0 2px 8px rgba(22,163,74,.08);
}
.alert-error {
    background: var(--error-bg);
    color: var(--error-fg);
    border: 1px solid var(--error-bd);
    box-shadow: 0 2px 8px rgba(220,38,38,.08);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s;
    white-space: nowrap;
}
.btn-primary   { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-lt); box-shadow: 0 4px 16px rgba(15,38,68,.25); }
.btn-success   { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.25); }
.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; box-shadow: 0 4px 12px rgba(217,119,6,.25); }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover  { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.btn-secondary {
    background: rgba(255,255,255,.40);
    color: var(--muted);
    border: 1px solid rgba(255,255,255,.50);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: rgba(255,255,255,.60);
    color: var(--text);
    border-color: rgba(255,255,255,.65);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Form Elements ───────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: rgba(255,255,255,.50);
    backdrop-filter: blur(8px);
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--navy);
    background: rgba(255,255,255,.70);
    box-shadow: 0 0 0 3px rgba(15,38,68,.08), 0 2px 8px rgba(15,38,68,.06);
}

.rtl-input { direction: rtl; text-align: right; }

/* ── Table (Glass) ───────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.40);
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
thead th {
    background: rgba(15,38,68,.82);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 13px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.30);
    font-size: 13px;
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.25); }
.rtl-cell { direction: rtl; text-align: right; font-family: Tahoma, sans-serif; }

/* ── Modal (Glass) ───────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,38,68,.35);
    z-index: 1000;
    padding: 16px;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal-box {
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: var(--radius);
    max-width: 640px;
    margin: 40px auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.70);
    overflow: hidden;
    position: relative;
}
.modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.80), transparent);
    pointer-events: none;
}
.modal-header {
    background: rgba(15,38,68,.82);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.22); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,.30);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Pagination ──────────────────────────────── */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-link {
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.45);
    color: var(--muted);
    transition: all .25s;
    background: rgba(255,255,255,.35);
    backdrop-filter: blur(8px);
}
.page-link:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 2px 8px rgba(15,38,68,.2); }

/* ── Utilities ───────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.badge-blue   { background: rgba(37,99,235,.10);  color: #1d4ed8; border: 1px solid rgba(37,99,235,.15); }
.badge-green  { background: rgba(22,163,74,.10);  color: #15803d; border: 1px solid rgba(22,163,74,.15); }
.badge-amber  { background: rgba(217,119,6,.10);  color: #b45309; border: 1px solid rgba(217,119,6,.15); }
.badge-purple { background: rgba(124,58,237,.10); color: #6d28d9; border: 1px solid rgba(124,58,237,.15); }
.badge-gray   { background: rgba(71,85,105,.08);  color: #475569; border: 1px solid rgba(71,85,105,.12); }

.text-muted { color: var(--muted); }
.text-small { font-size: 12px; }
.fw-bold { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.full-span { grid-column: span 2; }

/* ── Entrance Animations ─────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeSlideUp .4s ease-out backwards;
}

.card:nth-of-type(1) { animation-delay: .05s; }
.card:nth-of-type(2) { animation-delay: .15s; }
.card:nth-of-type(3) { animation-delay: .25s; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .page-wrap { padding: 18px 14px 40px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .topbar { padding: 0 14px; }
    .full-span { grid-column: span 1; }
}

/* ── EMS form controls ─────────────────────── */
.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--muted); margin-bottom: 6px; letter-spacing: .01em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
    color: var(--text); background: var(--surface-solid);
    border: 1px solid var(--border); border-radius: 10px;
    outline: none; transition: border-color .2s, box-shadow .2s;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(200,132,42,.15);
}
