/* CSS Reset & Variables */
:root {
    --primary-color: #1a4f8b;
    --primary-hover: #143d6b;
    --secondary-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-main: #f1f5f9;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    overflow: hidden; /* App container will handle scroll */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--secondary-color);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important for flex children to truncate text */
}

.topbar {
    height: var(--topbar-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

/* Shared UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.table-container {
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th, table.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table.data-table th {
    background-color: var(--secondary-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table.data-table tr:last-child td {
    border-bottom: none;
}

/* Utilities */
.hidden {
    display: none !important;
}
