:root {
    /* Minimalist Slate Palette */
    --primary: #475569;
    --primary-light: #f1f5f9;
    --primary-hover: #334155;
    
    /* Neutral Design Tokens */
    --bg-main: #fafafa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #737373;
    --border: #ececec;
    
    /* Radius & Spacing */
    --radius-md: 6px;
    --space-md: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.02);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

#app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Minimalist Sidebar */
#sidebar {
    background: white;
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo-area {
    padding: 10px 0 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #525252;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.1s;
}

.nav-item:hover {
    background: #f5f5f5;
    color: black;
}

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

/* Header */
#header {
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.header-search input {
    border: 1px solid var(--border);
    background: #f9f9f9;
    padding: 6px 12px 6px 32px;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 280px;
}

/* Simplified Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

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

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
}

.badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success { background: #f0fdf4; color: #166534; }
.badge-warning { background: #fffbeb; color: #92400e; }

/* Dashboard Adjustments */
.stat-card {
    padding: 16px;
}

.stat-label {
    font-size: 0.7rem;
    color: #737373;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--bg-main);
}

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

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

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

tr:hover td {
    background-color: #f9fafb;
}

/* Badge Styles */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* Modal */
#modal-container {
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}

#modal-content {
    border: none;
    box-shadow: var(--shadow-lg);
}

/* RTL Adjustments */
[dir="rtl"] .header-search i {
    left: auto;
    right: 12px;
}

[dir="rtl"] .header-search input {
    padding: 8px 36px 8px 12px;
}

[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: -12px;
    border-radius: 4px 0 0 4px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
