/* =====================================================
   DAX-IS Accounting System — Premium Theme + Mobile
   تصميم فاخر + دعم كامل للموبايل (Android + iPhone)
   ===================================================== */

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

:root {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-glow: rgba(96, 165, 250, 0.45);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;
    --gold: #c9a227;
    --gold-neon: #f59e0b;

    --dark: #0b1120;
    --darker: #020617;
    --glass-bg: rgba(15, 23, 42, 0.58);
    --glass-bg-strong: rgba(15, 23, 42, 0.82);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-hover: rgba(96, 165, 250, 0.38);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --sidebar-width: 265px;
    --sidebar-collapsed: 78px;
    --radius: 1.15rem;
    --radius-sm: 0.8rem;
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--darker);
    background-image:
        radial-gradient(ellipse at 15% 40%, rgba(59, 130, 246, 0.09) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(168, 85, 247, 0.07) 0%, transparent 50%),
        url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?ixlib=rb-4.0.3&q=80&w=2070');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 25%, rgba(15, 23, 42, 0.55) 0%, rgba(2, 6, 23, 0.93) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }
.text-glow-blue { color: #e0f2fe !important; text-shadow: 0 0 12px rgba(56, 189, 248, 0.35); }
.neon-text-success { color: #34d399 !important; text-shadow: 0 0 14px rgba(52, 211, 153, 0.5); }
.neon-text-blue { color: #60a5fa !important; text-shadow: 0 0 14px rgba(96, 165, 250, 0.5); }
.text-bright-white { color: #ffffff !important; text-shadow: 0 2px 8px rgba(0,0,0,0.7); font-weight: 700; }

/* Glass Components */
.glass-panel, .glass-panel-dark {
    background: var(--glass-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-box {
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg), 0 0 25px var(--primary-glow);
}
.metric-glow {
    position: absolute; width: 130px; height: 130px; border-radius: 50%;
    filter: blur(50px); top: -35px; right: -35px; z-index: 0; opacity: 0.55;
}
.glow-blue { background: #3b82f6; }
.glow-green { background: #10b981; }
.glow-amber { background: #f59e0b; }
.glow-purple { background: #8b5cf6; }
.metric-content { position: relative; z-index: 1; }

/* Buttons */
.btn-gradient-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; color: white !important; font-weight: 600;
    border-radius: 0.85rem; padding: 0.7rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}
.btn-gradient-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    color: white !important;
}

.btn-gradient-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none; color: white !important; font-weight: 600;
    border-radius: 0.85rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}
.btn-gradient-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    color: white !important;
}

.btn-gradient-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none; color: white !important; font-weight: 600;
    border-radius: 0.85rem; transition: all 0.3s ease;
}
.btn-gradient-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    color: white !important;
}

.btn-glass-outline {
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-glass-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.btn-glass {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.25s ease;
}
.btn-glass:hover {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
    color: #fff;
}

/* Forms */
.glass-input,
.form-control.glass-input,
.form-select.glass-input {
    background-color: rgba(0,0,0,0.35) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 0.85rem !important;
    padding: 0.75rem 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 16px;
}
.glass-input:focus {
    background-color: rgba(0,0,0,0.5) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22), 0 0 18px rgba(96, 165, 250, 0.15) !important;
    color: #fff !important;
}
.form-label { color: #94a3b8; font-weight: 600; font-size: 0.875rem; }

.form-check-input {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    cursor: pointer;
}
.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}
.form-switch .form-check-input { width: 2.9rem; height: 1.45rem; }

/* Tables */
.glass-table { color: #cbd5e1; margin-bottom: 0; }
.glass-table thead th {
    background: rgba(0,0,0,0.35) !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    font-weight: 600;
    padding: 1rem 1.1rem;
    white-space: nowrap;
}
.glass-table tbody td {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    padding: 0.95rem 1.1rem;
    vertical-align: middle;
}
.glass-table tbody tr:hover td { background: rgba(59, 130, 246, 0.07) !important; }

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

/* Badges */
.badge-cosmic {
    background: rgba(255,255,255,0.06) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
}
.badge-user-active {
    background: rgba(16,185,129,0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16,185,129,0.45) !important;
}
.badge-user-inactive {
    background: rgba(239,68,68,0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239,68,68,0.45) !important;
}

/* Dropdown */
.glass-dropdown {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 1rem !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    padding: 0.5rem;
}
.glass-dropdown .dropdown-item {
    color: #cbd5e1;
    border-radius: 0.6rem;
    padding: 0.65rem 1rem;
    transition: all 0.2s ease;
}
.glass-dropdown .dropdown-item:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #fff;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Cosmic Wrapper */
.cosmic-page-wrapper {
    background-image: url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?ixlib=rb-4.0.3&q=80&w=2070');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    border-radius: 1.4rem;
    padding: 26px 20px;
    min-height: 82vh;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
.cosmic-page-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.65) 0%, rgba(2, 6, 23, 0.94) 100%);
    z-index: 1;
}
.content-z-index { position: relative; z-index: 2; }

/* Mobile */
@media (max-width: 991.98px) {
    .metric-card { margin-bottom: 0.9rem; }
    .metric-card:hover { transform: none; }

    .btn-gradient-primary,
    .btn-gradient-success,
    .btn-gradient-warning {
        min-height: 48px;
    }

    .glass-table thead th,
    .glass-table tbody td {
        padding: 0.75rem 0.8rem;
        font-size: 0.9rem;
    }

    .cosmic-page-wrapper {
        padding: 16px 12px;
        border-radius: 1rem;
        min-height: auto;
    }
}

@media (max-width: 576px) {
    .glass-panel {
        border-radius: 1rem;
        padding: 1rem !important;
    }
    .btn-gradient-primary,
    .btn-gradient-success {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    h1, .h3 { font-size: 1.35rem !important; }
}

@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(96,165,250,0.35); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,0.55); }



/* =====================================================
   تكبير الواجهة على الموبايل (صفحة الدخول + كل الصفحات)
   ===================================================== */
@media (max-width: 768px) {

  /* تكبير أساسي لكل الصفحات */
  html {
    font-size: 18px;
  }

  body {
    font-size: 1rem;
  }

  /* أزرار أسهل للمس */
  .btn,
  .btn-sm,
  .btn-glass,
  .btn-gradient-primary,
  .btn-gradient-success,
  .btn-gradient-warning,
  .btn-cosmic {
    min-height: 48px;
    font-size: 1.05rem !important;
    padding: 0.7rem 1.1rem !important;
    border-radius: 0.75rem;
  }

  .btn-sm {
    min-height: 42px;
    font-size: 0.95rem !important;
  }

  /* حقول الإدخال */
  .form-control,
  .form-select,
  .glass-input,
  input,
  select,
  textarea {
    min-height: 48px !important;
    font-size: 16px !important; /* يمنع الزوم التلقائي على iOS */
    padding: 0.85rem 1rem !important;
  }

  /* عناوين */
  h1, .h1 { font-size: 1.55rem !important; }
  h2, .h2 { font-size: 1.3rem !important; }
  h3, .h3 { font-size: 1.15rem !important; }

  /* كروت */
  .card,
  .glass-panel,
  .glass-panel-dark {
    border-radius: 1rem;
  }

  /* جداول */
  .table,
  .glass-table {
    font-size: 0.95rem;
  }

  .glass-table thead th,
  .glass-table tbody td {
    padding: 0.75rem 0.8rem;
  }

  /* نافبار أوضح على الموبايل */
  .glass-navbar .btn-glass {
    min-height: 42px;
    padding: 0.45rem 0.75rem !important;
  }

  /* ====== صفحة الدخول تحديداً ====== */
  .glass-login-card {
    max-width: 95% !important;
    margin: 0 auto;
    padding: 1.75rem 1.25rem !important;
  }

  .glass-login-card h1,
  .glass-login-card h2,
  .glass-login-card .login-title {
    font-size: 1.45rem !important;
  }

  .input-group-glass .glass-input {
    font-size: 1.1rem !important;
    padding: 1rem 3rem 1rem 1rem !important;
    min-height: 52px !important;
  }

  .btn-cosmic {
    min-height: 52px !important;
    font-size: 1.15rem !important;
    padding: 0.95rem !important;
  }

  .developer-name {
    font-size: 1.05rem !important;
  }

  .developer-label {
    font-size: 0.75rem !important;
  }

  .developer-box {
    padding: 1rem 0.85rem !important;
  }

  /* كروت المقاييس */
  .metric-card {
    margin-bottom: 0.9rem;
  }

  .metric-card:hover {
    transform: none;
  }

  /* الصفحة الكونية */
  .cosmic-page-wrapper {
    padding: 16px 12px;
    border-radius: 1rem;
    min-height: auto;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 17px;
  }

  .glass-panel {
    border-radius: 1rem;
    padding: 1rem !important;
  }

  .btn-gradient-primary,
  .btn-gradient-success,
  .btn-cosmic {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  h1, .h3 {
    font-size: 1.35rem !important;
  }

  .glass-login-card {
    padding: 1.5rem 1rem !important;
  }
}

/* Print */
@media print {
    body { background: white !important; color: black !important; }
    .glass-navbar, .glass-sidebar, .glass-footer, .sidebar-overlay { display: none !important; }
    .glass-panel, .metric-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
