/**
 * Smart Connection - Super Admin Panel Stylesheet
 * Dark theme, RTL, professional dashboard design
 */

/* ============================================
   Google Fonts
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --bg-dark: #0f1923;
    --bg-card: #1a2836;
    --bg-sidebar: #0a1219;
    --bg-hover: #243447;
    --text-white: #ffffff;
    --text-gray: #8899a6;
    --text-muted: #5c6e7e;
    --accent: #FFB162;
    --accent-dark: #E8973D;
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --border: #1e3a4f;
    --radius: 12px;
    --sidebar-width: 250px;
    --transition: 0.2s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--bg-dark);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.3px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 12px;
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.nav-item.active {
    background: rgba(255, 177, 98, 0.08);
    color: var(--accent);
    border-right: 3px solid var(--accent);
    border-radius: 8px 0 0 8px;
}

.nav-item i,
.nav-item .nav-icon {
    width: 20px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--red);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-dark);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all var(--transition);
    font-size: 16px;
}

.btn-logout:hover {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    padding: 30px;
    background: var(--bg-dark);
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.top-bar-right {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-search {
    position: relative;
}

.top-bar-search input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-white);
    padding: 8px 16px 8px 36px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    width: 220px;
    transition: all var(--transition);
    direction: rtl;
}

.top-bar-search input::placeholder {
    color: var(--text-muted);
}

.top-bar-search input:focus {
    outline: none;
    border-color: var(--accent);
    width: 280px;
}

.top-bar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-white);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-title {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card-icon.orange {
    background: rgba(255, 177, 98, 0.12);
    color: var(--accent);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green);
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue);
}

.stat-card-icon.red {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

.stat-card-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card-change.up {
    color: var(--green);
}

.stat-card-change.down {
    color: var(--red);
}

/* ============================================
   Cards & Panels
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grid layout for cards */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* ============================================
   Data Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: right;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(10, 18, 25, 0.4);
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(30, 58, 79, 0.4);
    color: var(--text-gray);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

.td-main {
    color: var(--text-white);
    font-weight: 600;
}

.td-small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Table action buttons */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition);
}

.btn-action.view {
    background: rgba(255, 177, 98, 0.1);
    color: var(--accent);
}

.btn-action.view:hover {
    background: rgba(255, 177, 98, 0.2);
}

.btn-action.edit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

.btn-action.edit:hover {
    background: rgba(59, 130, 246, 0.2);
}

.btn-action.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.btn-action.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================
   Status Badges
   ============================================ */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green);
}

.badge-status.inactive,
.badge-status.cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.badge-status.suspended,
.badge-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--yellow);
}

/* Plan Badges */
.badge-plan {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-plan.free {
    background: rgba(92, 110, 126, 0.2);
    color: var(--text-gray);
}

.badge-plan.starter {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.badge-plan.pro {
    background: rgba(255, 177, 98, 0.15);
    color: var(--accent);
}

.badge-plan.enterprise {
    background: linear-gradient(135deg, rgba(255, 177, 98, 0.2), rgba(245, 158, 11, 0.2));
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ============================================
   System Status
   ============================================ */
.system-status {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 18, 25, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.status-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.healthy {
    background: var(--green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse-green 2s infinite;
}

.status-dot.unhealthy {
    background: var(--red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: pulse-red 1.5s infinite;
}

.status-dot.warning {
    background: var(--yellow);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
}

@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 4px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
}

.status-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-white);
}

.status-value {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Bar Chart (CSS only)
   ============================================ */
.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 0;
}

.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    min-width: 80px;
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
    text-align: left;
}

.chart-bar-track {
    flex: 1;
    height: 28px;
    background: rgba(10, 18, 25, 0.5);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--bg-dark);
    min-width: 40px;
}

.chart-bar-fill.orange { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.chart-bar-fill.green { background: linear-gradient(90deg, var(--green), #059669); }
.chart-bar-fill.blue { background: linear-gradient(90deg, var(--blue), #2563eb); }
.chart-bar-fill.gray { background: linear-gradient(90deg, var(--text-muted), #4a5e6f); }
.chart-bar-fill.yellow { background: linear-gradient(90deg, var(--yellow), #d97706); }

.chart-bar-value {
    min-width: 40px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-dark);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 177, 98, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--red);
    color: white;
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: var(--green);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 177, 98, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238899a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Checkbox / Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 12px;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    right: 2px;
    bottom: 2px;
    background: var(--text-gray);
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(-20px);
    background: white;
}

/* ============================================
   Modal / Dialog
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.modal-show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.modal-overlay.modal-show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text-white);
    background: var(--bg-hover);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* Large Modal */
.modal-lg {
    max-width: 720px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    padding: 0 4px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-white);
    border-color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
    font-weight: 700;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 12px;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 177, 98, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow:
        0 0 80px rgba(255, 177, 98, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--bg-dark);
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    padding: 12px 16px;
    font-size: 15px;
    background: var(--bg-dark);
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ============================================
   Loading States
   ============================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-title {
    height: 22px;
    margin-bottom: 12px;
    width: 50%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: inherit;
    max-width: 90%;
    white-space: nowrap;
}

.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: var(--green);
    color: white;
}

.toast-error {
    background: var(--red);
    color: white;
}

.toast-info {
    background: var(--blue);
    color: white;
}

.toast-warning {
    background: var(--yellow);
    color: var(--bg-dark);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 300px;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-accent { color: var(--accent) !important; }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-yellow { color: var(--yellow) !important; }
.text-blue { color: var(--blue) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-gray { color: var(--text-gray) !important; }
.text-white { color: var(--text-white) !important; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.overflow-hidden { overflow: hidden; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rounded { border-radius: var(--radius); }
.border { border: 1px solid var(--border); }

.w-100 { width: 100%; }

.cursor-pointer { cursor: pointer; }

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

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Responsive - Mobile (< 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(100%);
        width: 280px;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding: 20px 16px;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Mobile overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-bar-left {
        width: 100%;
    }

    .top-bar-search input {
        width: 100%;
    }

    .top-bar-search input:focus {
        width: 100%;
    }

    .page-title {
        font-size: 20px;
    }

    .table-actions {
        flex-direction: column;
    }

    .card-header {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .modal {
        width: 95%;
        margin: 10px;
    }

    .login-card {
        padding: 28px 24px;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .sidebar,
    .sidebar-overlay,
    .mobile-toggle,
    .top-bar-search,
    .btn,
    .table-actions,
    .pagination,
    .toast {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
