*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --bg: #f6f6f7;
    --surface: #ffffff;
    --border: #e3e3e8;
    --text-primary: #1a1a1a;
    --text-secondary: #6d7175;
    --text-tertiary: #b0b0b8;
    --accent: #008060;
    --accent-light: #e3f5ef;
    --accent-hover: #006e52;
    --danger: #d72c0d;
    --danger-light: #fef3f2;
    --warning: #ffc453;
    --warning-light: #fff5e6;
    --info: #006fbb;
    --info-light: #e8f4fd;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --transition: 150ms cubic-bezier(.4,0,.2,1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }

/* ── LAYOUT ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: #1a1a1a;
    color: #e5e5e5;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ── CARD ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 16px 20px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    white-space: nowrap;
}

.btn:hover { background: var(--bg); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
}
.btn-danger:hover { background: #b52209; }

/* ── TABLE ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafbfc; }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green  { background: var(--accent-light); color: var(--accent); }
.badge-gray   { background: var(--bg); color: var(--text-secondary); }
.badge-red    { background: var(--danger-light); color: var(--danger); }
.badge-yellow { background: var(--warning-light); color: #8a5200; }
.badge-blue   { background: var(--info-light); color: var(--info); }

/* ── FORM ── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg);
    transition: border-color var(--transition);
    outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,128,96,.1);
}

/* ── UTILITIES ── */
.text-secondary { color: var(--text-secondary); }
.text-accent    { color: var(--accent); }
.text-danger    { color: var(--danger); }
.fw-600         { font-weight: 600; }
.fs-12          { font-size: 12px; }
.fs-13          { font-size: 13px; }

.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }

.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99em; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ── MOBILE ── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .page-content { padding: 16px; }
}