:root {
    --primary-color: #3b82f6; /* Electric Blue */
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --accent-color: #3b82f6; /* Added for compatibility */
    --sidebar-bg: #0f172a; /* Deep Navy */
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --bg-color: #f1f5f9; /* Light Grey */
    --text-color: #334155; /* Slate Grey */
    --heading-color: #1e293b;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--sidebar-text-active);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link .icon {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px; /* Match sidebar width */
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent overflow issues */
}

/* Topbar */
.topbar {
    height: 64px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    color: var(--heading-color);
}

.content-wrapper {
    padding: 2rem;
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.card h2, .card h3 {
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Stats Card */
.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
}

.stat-label {
    color: #64748b;
    font-size: 0.875rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.yojak-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.yojak-table th {
    background-color: #f8fafc;
    color: var(--text-color);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.yojak-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--heading-color);
}

.yojak-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--white);
}

.yojak-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

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

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

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

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

.btn-secondary:hover {
    background-color: #f8fafc;
}

/* Utilities */
.text-right { text-align: right; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Grid */
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-split-70-30 {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-split-70-30 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar.open {
        transform: translateX(0);
    }
}

/* Custom Components */
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feed-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.feed-item:last-child { border-bottom: none; }
.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.filter-select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}
.filter-select option { color: #333; }

.alert-card {
    background: white;
    border-left: 4px solid var(--danger-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alert-card.warning { border-left-color: #f59e0b; }

.alert-content h4 { margin: 0 0 0.25rem 0; font-size: 1rem; color: #1e293b; }
.alert-content p { margin: 0; font-size: 0.9rem; color: #64748b; }

.btn-alert {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    background: #f1f5f9;
    color: #334155;
    transition: all 0.2s;
    display: inline-block;
}
.btn-alert:hover { background: #e2e8f0; }

.hero-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.text-muted { color: #64748b; }
.text-center { text-align: center; }

/* Tabs */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: var(--text-color);
}

.tab-btn.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #94a3b8;
}

.close-btn:hover {
    color: var(--text-color);
}

/* Login Page */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1;
    background: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    padding: 2rem;
}

.login-form-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
}

.login-form-box h2 {
    margin-bottom: 0.5rem;
    color: var(--heading-color);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--heading-color);
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    .login-brand {
        padding: 2rem;
        flex: 0 0 auto;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Status Colors */
.status-open { background: #dcfce7; color: #15803d; }
.status-closed { background: #f1f5f9; color: #475569; }

/* Dropdown (Simplified) */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--white);
    min-width: 160px;
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    z-index: 10;
    border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    display: block;
    color: var(--text-color);
}

.dropdown-item:hover {
    background-color: #f8fafc;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-color);
}
