:root {
  --primary: #0f172a;
  --accent: #D4FC4B;
  --accent-light: #eff6ff;
  --bg: #030712;
  --surface: #FFFFFF;
  --text: #1a1a1a;
  --text-muted: #6B7280;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --border: #E5E7EB;
  --radius: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  background: #030712;
  color: var(--text);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #0056fd;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  padding: 8px 16px;
}
.btn-ghost:hover {
  background: var(--accent-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Form styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  direction: rtl;
  text-align: right;
  transition: border-color 0.2s;
  background: var(--surface);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input.error {
  border-color: var(--danger);
}

.form-input.success {
  border-color: var(--success);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.field-status {
  font-size: 13px;
  margin-top: 4px;
}

.field-status.valid { color: var(--success); }
.field-status.invalid { color: var(--danger); }

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-completed { background: #E0E7FF; color: #3730A3; }

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg);
}

table tr:hover td {
  background: var(--accent-light);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: slideDown 0.3s ease;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-warning { background: var(--warning); color: white; }

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Spinner */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner-ring {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  margin-bottom: 20px;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 16px;
  margin-top: 8px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 24px;
}

/* Layout */
.main-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--primary);
  color: white;
  padding: 24px 0;
  position: fixed;
  top: 0; right: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 700;
}

.sidebar-nav {
  padding: 0 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  margin-right: 260px;
  padding: 32px;
  min-height: 100vh;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    padding: 16px 0;
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 8px;
  }
  .sidebar-nav a {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 12px;
  }
  .sidebar-logo {
    padding: 0 16px 16px;
  }
  .main-content {
    margin-right: 0;
    padding: 16px;
  }
  .page-header h2 {
    font-size: 20px;
  }
  .tabs {
    overflow-x: auto;
  }
  .tab {
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
}
