:root {
    /* Color Palette - Professional Financial/Industrial Theme */
    --primary: #003366;
    --primary-light: #004a93;
    --secondary: #6c757d;
    --accent: #f39c12;
    --success: #28a745;
    --danger: #dc3545;
    --bg-main: #f4f7f9;
    --bg-sidebar: #2c3e50;
    --bg-card: #ffffff;
    --border-color: #d1d9e6;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-on-dark: #ffffff;
    
    /* Spacing & Sizing */
    --sidebar-width: 240px;
    --header-height: 70px;
    --radius: 4px;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
    
    /* Typography */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-on-dark);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.2);
}

.nav-group {
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-on-dark);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: white;
    border-left: 4px solid var(--accent);
}

.nav-item svg {
    margin-right: 12px;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-submenu {
    background-color: rgba(0,0,0,0.15);
    padding-left: 10px;
}

.nav-submenu .nav-item {
    padding-left: 52px;
    font-size: 0.85rem;
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: var(--header-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.brand-title {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--primary);
    text-transform: uppercase;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.placeholder-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Secondary Nav / Tabs */
.tab-bar {
    background-color: var(--primary);
    display: flex;
    padding: 0 30px;
}

.tab-item {
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-item:hover {
    color: white;
}

.tab-item.active {
    color: white;
    border-bottom-color: var(--accent);
    background-color: rgba(255,255,255,0.1);
}

/* Page Content */
.content {
    padding: 30px;
    flex-grow: 1;
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Controls / Filter Bar */
.control-bar {
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-input, .form-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    min-width: 180px;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-light);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

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

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f8f9fa;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Data Grid / Table */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-header {
    padding: 15px 20px;
    background-color: #fcfcfc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.table th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 12px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.table tr:hover {
    background-color: #fcfcfc;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
}

.icon-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: #e6f4ea; color: #1e7e34; }
.badge-warning { background: #fff4e5; color: #b7791f; }
.badge-danger { background: #fdeaea; color: #c53030; }

/* Grid Layout for Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 40px;
    padding: 20px;
}

.form-full {
    grid-column: span 2;
}

/* State List / Multi-select simulation */
.state-selector {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 15px;
    align-items: center;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: var(--radius);
}

.state-list {
    height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 5px;
}

.state-item {
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.state-item:hover {
    background: #f0f4f8;
}

.state-item.selected {
    background: var(--primary-light);
    color: white;
}

.state-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Utilities */
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.items-center { align-items: center; }

/* Dashboard Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-light);
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 5px;
    color: var(--primary);
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: 5px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
