* {
    box-sizing: border-box;
}

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --sidebar: #0f172a;
    --sidebar-2: #111827;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --gray: #6b7280;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4f9 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 255px;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    padding: 22px 16px;
    color: #fff;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    z-index: 1000;
}

.sidebar h2 {
    margin: 0 0 22px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 14px 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.sidebar a {
    display: block;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    padding: 13px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.10);
    transform: translateX(4px);
}

.sidebar hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin: 16px 0;
}

/* Main layout */
.main-content {
    margin-left: 255px;
    padding: 24px;
}

/* Topbar */
.topbar {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226,232,240,0.8);
    box-shadow: var(--shadow);
    border-radius: 22px;
    padding: 18px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.topbar-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.topbar-user {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

/* Cards */
.card {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(226,232,240,0.85);
    box-shadow: var(--shadow);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 22px;
}

.card h2 {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 800;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
}

.card p {
    margin: 0;
    color: var(--muted);
}

/* Grid */
.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.col {
    grid-column: span 3;
}

.col-4 {
    grid-column: span 4;
}

.col-6 {
    grid-column: span 6;
}

.col-12 {
    grid-column: span 12;
}

/* Stat cards */
.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    min-height: 120px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.05);
}

.stat-title {
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 30px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.stat-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
}

/* Forms */
label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

input,
textarea,
select,
button {
    width: 100%;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 14px;
    outline: none;
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    border: none;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37,99,235,0.22);
}

button:hover {
    filter: brightness(1.03);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

table th {
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table td {
    padding: 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #334155;
    vertical-align: top;
}

table tr:hover td {
    background: #f8fbff;
}

table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}

table a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(226,232,240,0.8);
    box-shadow: var(--shadow);
    border-radius: 18px;
    padding: 16px 20px;
    color: var(--muted);
    font-size: 14px;
}

/* Status */
.status-pending {
    color: var(--warning);
    font-weight: 900;
}

.status-sent {
    color: var(--primary);
    font-weight: 900;
}

.status-completed {
    color: var(--success);
    font-weight: 900;
}

.status-failed {
    color: var(--danger);
    font-weight: 900;
}

.status-cancelled {
    color: var(--gray);
    font-weight: 900;
}

/* Login */
.login-page {
    background: radial-gradient(circle at top right, #dbeafe 0%, #eff6ff 28%, #f8fafc 100%);
}

.login-box {
    width: 100%;
    max-width: 430px;
    margin: 90px auto;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(226,232,240,0.9);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(15,23,42,0.14);
    padding: 32px 28px;
}

.login-box h2 {
    margin: 0 0 18px;
    text-align: center;
    font-size: 28px;
    font-weight: 900;
}

.login-box p {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin: 8px 0 0;
}

/* Helpers */
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #eff6ff;
    color: var(--primary);
}

pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    overflow: auto;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .col,
    .col-4,
    .col-6 {
        grid-column: span 6;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-radius: 0 0 20px 20px;
    }

    .main-content {
        margin-left: 0;
        padding: 18px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .col,
    .col-4,
    .col-6,
    .col-12 {
        grid-column: span 12;
    }
}