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

:root {
    --bg: #fff;
    --accents-1: #fafafa;
    --accents-2: #eaeaea;
    --accents-3: #999;
    --accents-4: #888;
    --accents-5: #666;
    --accents-6: #444;
    --accents-7: #333;
    --accents-8: #111;
    --foreground: #000;
    --success: #0070f3;
    --error: #ee0000;
    --selection: #f81ce5;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --shadow-small: 0 5px 10px rgba(0,0,0,0.12);
    --shadow-medium: 0 8px 30px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--foreground);
    font-family: var(--font-sans);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
}

header {
    width: 260px;
    background: var(--accents-1);
    border-right: 1px solid var(--accents-2);
    padding: 32px 24px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.container {
    flex: 1;
    margin-left: 260px;
    padding: 48px;
    max-width: 1400px;
    margin-right: auto;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--foreground);
}

.header-section {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--accents-2);
    padding-bottom: 24px;
}

.header-section h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
}

nav li {
    margin-bottom: 4px;
}

nav a {
    color: var(--accents-5);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--foreground);
    background: var(--accents-2);
}

nav a.active {
    font-weight: 600;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-container img {
    height: 32px;
    width: auto;
}

.logo-container span {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.02em;
}

/* Tenant Selector */
.tenant-selector-container {
    margin-bottom: 32px;
}

.tenant-selector-container label {
    display: block;
    font-size: 11px;
    color: var(--accents-4);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

select {
    width: 100%;
    background: var(--bg);
    color: var(--foreground);
    border: 1px solid var(--accents-2);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

/* Card System */
.card {
    background: var(--bg);
    border: 1px solid var(--accents-2);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--accents-2);
    padding: 24px;
    border-radius: 12px;
}

.stat-label { font-size: 11px; color: var(--accents-4); font-weight: 600; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.05em; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--accents-4);
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--accents-2);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--accents-1);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(0, 112, 243, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 166, 35, 0.1); color: #f5a623; }

/* Form Styles */
.form-group { margin-bottom: 24px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--accents-6); margin-bottom: 8px; display: block; }

input[type="text"], input[type="url"], input[type="password"], input[type="email"], input[type="datetime-local"], textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--accents-2);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    border-color: var(--accents-6);
}

button, .btn-primary {
    background: var(--foreground);
    color: var(--bg);
    border: 1px solid var(--foreground);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover, .btn-primary:hover {
    background: transparent;
    color: var(--foreground);
}

.btn-secondary {
    background: var(--bg);
    color: var(--accents-5);
    border: 1px solid var(--accents-2);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--accents-2);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-medium);
}

/* Utilities */
.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 16px; }
.text-small { font-size: 13px; color: var(--accents-5); }

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    header { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--accents-2); padding: 24px; }
    .container { margin-left: 0; padding: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
}
