/* ════════════════════════════════════════════════════
   Equipation Portal — Styles
   ════════════════════════════════════════════════════ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    direction: rtl;
}

.bg-light {
    background: #f9fafb;
    min-height: 100vh;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ═══════════════════════════════════
   Login Page
   ═══════════════════════════════════ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.logo-circle.small {
    width: 36px;
    height: 36px;
    font-size: 18px;
    margin: 0;
}

.logo h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.logo p {
    color: #6b7280;
}

.features {
    margin: 2rem 0;
}

.feature {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.feature:last-child {
    border-bottom: none;
}

.feature .icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.feature h3 {
    font-size: 15px;
    color: #1f2937;
}

.feature p {
    font-size: 13px;
    color: #6b7280;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: white;
    color: #1f2937;
    border: 2px solid #e5e7eb;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.footer-note {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 1.5rem;
}

/* ═══════════════════════════════════
   Navbar
   ═══════════════════════════════════ */

.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-links a.active {
    color: #667eea;
    background: #f0f1ff;
}

.nav-links a.logout {
    color: #ef4444;
}

/* ═══════════════════════════════════
   Container & Cards
   ═══════════════════════════════════ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.muted {
    color: #6b7280;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 1rem;
}

.card.warning {
    border-color: #fcd34d;
    background: #fef3c7;
}

.card.warning h2 {
    color: #92400e;
}

/* ═══════════════════════════════════
   Stats
   ═══════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #1f2937;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    margin-left: 8px;
}

/* ═══════════════════════════════════
   Tables
   ═══════════════════════════════════ */

.table-wrap {
    overflow-x: auto;
}

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

table th {
    background: #f9fafb;
    text-align: right;
    padding: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

table tr:hover {
    background: #f9fafb;
}

.loading {
    text-align: center;
    color: #9ca3af;
    padding: 2rem !important;
}

/* ═══════════════════════════════════
   Key-Value Grid
   ═══════════════════════════════════ */

.kv-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.5rem;
    font-size: 14px;
}

.kv-grid > div:nth-child(odd) {
    color: #6b7280;
}

/* ═══════════════════════════════════
   Forms
   ═══════════════════════════════════ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: #6b7280;
    font-size: 12px;
}

/* ═══════════════════════════════════
   Buttons
   ═══════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.375rem 0.75rem;
    font-size: 13px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-toggle {
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.375rem 0.75rem;
    font-size: 13px;
}

.btn-toggle:hover {
    background: #e5e7eb;
}

/* ═══════════════════════════════════
   Alerts
   ═══════════════════════════════════ */

.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ═══════════════════════════════════
   Steps
   ═══════════════════════════════════ */

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active .step-num {
    background: #667eea;
    color: white;
}

.step-label {
    font-size: 13px;
    color: #6b7280;
}

.step-line {
    height: 2px;
    background: #e5e7eb;
    flex: 0 0 60px;
    margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════
   Step Detail (collapsible)
   ═══════════════════════════════════ */

.step-detail {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.step-detail summary {
    cursor: pointer;
    font-weight: 500;
    color: #1f2937;
}

.step-detail ol {
    margin-top: 0.75rem;
    padding-right: 1.5rem;
    color: #4b5563;
    font-size: 14px;
}

.step-detail ol li {
    margin-bottom: 0.5rem;
}

.step-detail code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #db2777;
}

.hint {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f0f9ff;
    border-radius: 6px;
    font-size: 13px;
    color: #075985;
}

/* ═══════════════════════════════════
   Recent List
   ═══════════════════════════════════ */

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-meta {
    color: #6b7280;
    font-size: 12px;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f3f4f6; color: #4b5563; }
