:root {
    --bg-dark: #020617;
    --sidebar-bg: #0f172a;
    --card-bg: #1e293b;
    --primary: #38bdf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Noto Sans Arabic', sans-serif;
    margin: 0;
    overflow: hidden;
}

/* Login Overlay */
.login-overlay {
    position: fixed; inset: 0; background: #020617; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    background: var(--card-bg); padding: 40px; border-radius: 20px;
    width: 100%; max-width: 400px; text-align: center;
    border: 1px solid var(--border);
}
.login-box h2 { margin-bottom: 24px; color: var(--primary); }

/* Layout */
.admin-wrapper {
    display: flex; height: 100vh;
    filter: blur(5px); transition: filter 0.3s;
}
.admin-wrapper.active { filter: none; }

/* Sidebar */
.sidebar {
    width: 260px; background: var(--sidebar-bg); border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); }
.sidebar-header h3 { margin: 0; color: var(--primary); }
.sidebar-nav { flex: 1; padding: 20px 10px; display: flex; flex-direction: column; gap: 8px; }
.nav-item {
    background: none; border: none; color: var(--text-muted);
    padding: 12px 16px; border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 12px; font-size: 14px;
    width: 100%; text-align: right; transition: all 0.2s; font-family: inherit;
}
.nav-item:hover, .nav-item.active { background: rgba(56, 189, 248, 0.1); color: var(--primary); }
.badge {
    margin-right: auto; background: var(--primary); color: #000;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: bold;
}
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-header {
    padding: 20px 30px; background: rgba(15, 23, 42, 0.8);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 40px; height: 40px; background: var(--primary); color: #000;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

/* Tabs */
.tab-content { display: none; padding: 30px; overflow-y: auto; height: 100%; }
.tab-content.active { display: block; }

/* Dashboard Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: var(--card-bg); padding: 24px; border-radius: 16px;
    display: flex; align-items: center; gap: 20px; border: 1px solid var(--border);
}
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-value { display: block; font-size: 28px; font-weight: bold; margin-top: 5px; }

/* Tables */
.table-container { background: var(--card-bg); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 24px; text-align: right; border-bottom: 1px solid var(--border); }
th { background: rgba(0,0,0,0.2); color: var(--text-muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Order Cards */
.orders-list { display: grid; gap: 16px; }
.order-card {
    background: var(--card-bg); padding: 20px; border-radius: 12px;
    border: 1px solid var(--border); display: flex; justify-content: space-between;
    align-items: center; cursor: pointer; transition: transform 0.2s;
}
.order-card:hover { transform: translateX(-5px); border-color: var(--primary); }
.order-header h4 { margin: 0 0 4px 0; color: #fff; }
.order-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }
.status-badge {
    padding: 4px 12px; border-radius: 20px; font-size: 12px;
    background: rgba(56, 189, 248, 0.1); color: var(--primary);
}

/* Forms */
.rates-editor, .tracking-manager { max-width: 800px; margin: 0 auto; }
.rate-group { margin-bottom: 24px; }
.rate-group label { display: block; margin-bottom: 8px; color: var(--text-muted); }
.input-wrapper { display: flex; align-items: center; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 0 16px; border: 1px solid var(--border); }
.input-wrapper input { background: none; border: none; padding: 16px 0; width: 100%; color: #fff; outline: none; }
.btn-primary {
    background: var(--primary); color: #000; border: none;
    padding: 12px 24px; border-radius: 8px; font-weight: bold; cursor: pointer;
    font-family: inherit;
}

/* Modal */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000;
    display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.modal.active { display: flex; }
.modal-content {
    background: var(--card-bg); padding: 30px; border-radius: 20px;
    width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    position: relative; border: 1px solid var(--border);
}
.close-modal { position: absolute; top: 20px; left: 20px; font-size: 24px; cursor: pointer; }

/* Tracking Grid */
.tracking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.track-card {
    background: var(--card-bg); padding: 20px; border-radius: 16px;
    border: 1px solid var(--border);
}
.track-card-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.track-id { font-weight: bold; color: var(--primary); }
.step-input-group { 
    background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; margin-bottom: 10px;
    border: 1px solid var(--border);
}
.step-input-group input { 
    width: 100%; background: none; border: none; color: #fff; margin-bottom: 5px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px;
}
.step-check-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }