/* ===========================
   UK Education Service - site.css
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ecfeff;
    --secondary: #64748b;
    --success: #15803d;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: #14b8a6;
    --sidebar-text: #dbe4f0;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 280px;
    --topbar-height: 72px;
    --body-bg: #f3f6fb;
    --card-shadow: 0 12px 34px rgba(15,23,42,.08);
    --border-color: #d7e2ee;
    --font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --surface: #ffffff;
    --surface-2: #f8fbff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 14px;
    background: linear-gradient(180deg,#f8fbff,#eff4fa);
    color: #1f2937;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Login Page
   =========================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(20,184,166,.12), transparent 35%), linear-gradient(180deg,#f8fbff,#eef4fb);
    padding: 32px 16px;
    gap: 24px;
}

.login-box {
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border: 1px solid var(--border-color);
}

.login-side-panel {
    width: 100%;
    max-width: 540px;
}

.login-side-card {
    background: linear-gradient(135deg, #0f172a, #0b2239);
    color: #fff;
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--card-shadow);
}

.login-side-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    font-size: 12px;
    margin-bottom: 18px;
}

.login-side-card h1 {
    font-size: 34px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.login-side-card p {
    color: #dbeafe;
    line-height: 1.9;
    margin-bottom: 22px;
}

.login-feature-list {
    display: grid;
    gap: 12px;
}

.login-feature-list div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
}

.login-feature-list i {
    color: #5eead4;
}

.login-shell-brand {
    position: fixed;
    top: 18px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
}

.login-shell-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
}

.login-shell-title {
    font-size: 15px;
    font-weight: 800;
}

.login-shell-subtitle {
    font-size: 12px;
    color: var(--secondary);
}

.login-shell-lang {
    display: flex;
    gap: 8px;
}

.login-shell-lang a {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.login-shell-lang a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary-light), #dff7f5);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.login-logo h2 {
    color: #0f172a;
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--secondary);
    font-size: 0.9rem;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-control {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fbfdff;
}

.login-box .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.login-box .btn-primary {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    border-color: var(--primary);
    transition: background 0.2s, transform 0.2s;
}

.login-box .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.login-lang {
    text-align: center;
    margin-top: 16px;
}

.login-lang a {
    color: var(--secondary);
    font-size: 13px;
    margin: 0 6px;
}

.login-lang a:hover,
.login-lang a.active {
    color: var(--primary);
    font-weight: 600;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
    position: fixed;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0f172a, #111827);
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 12px 0 40px rgba(15,23,42,.12);
}

[dir="ltr"] .sidebar { left: 0; }
[dir="rtl"] .sidebar { right: 0; }

.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-brand .brand-text small {
    display: block;
    color: var(--sidebar-text);
    font-size: 11px;
    font-weight: 400;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 10px;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    border-radius: 14px;
}

[dir="ltr"] .sidebar-menu li a {
    border-left: 3px solid transparent;
}

[dir="rtl"] .sidebar-menu li a {
    border-right: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu li.active a {
    background: linear-gradient(90deg, rgba(20,184,166,.28), rgba(15,118,110,.35));
    color: var(--sidebar-text-active);
    box-shadow: inset 0 0 0 1px rgba(94,234,212,.15);
}

[dir="ltr"] .sidebar-menu li.active a {
    border-left-color: var(--sidebar-active);
}

[dir="rtl"] .sidebar-menu li.active a {
    border-right-color: var(--sidebar-active);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,.08);
    margin: 10px 14px;
}

.sidebar-section-title {
    padding: 12px 20px 4px;
    color: #80868b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================
   Topbar
   =========================== */
.topbar {
    position: fixed;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-page-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--secondary);
}

[dir="ltr"] .topbar { left: var(--sidebar-width); right: 0; }
[dir="rtl"] .topbar { right: var(--sidebar-width); left: 0; }

.topbar .sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--secondary);
    cursor: pointer;
    padding: 4px 8px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 13px;
}

.topbar-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.topbar-user .user-info strong {
    display: block;
    font-size: 13px;
}

.topbar-user .user-info small {
    color: var(--secondary);
    font-size: 11px;
}

.lang-switch {
    font-size: 12px;
}

.lang-switch a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--secondary);
    border: 1px solid var(--border-color);
    transition: all 0.15s;
}

.lang-switch a:hover,
.lang-switch a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===========================
   Main Content
   =========================== */
.main-content {
    padding-top: calc(var(--topbar-height) + 26px);
    padding-bottom: 24px;
    min-height: 100vh;
}

[dir="ltr"] .main-content { margin-left: var(--sidebar-width); padding-left: 28px; padding-right: 28px; }
[dir="rtl"] .main-content { margin-right: var(--sidebar-width); padding-right: 28px; padding-left: 28px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h4 {
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    font-size: 28px;
}

.hero-panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px 28px;
    box-shadow: var(--card-shadow);
}

.hero-panel-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-title {
    margin: 0 0 6px;
    font-size: 34px;
    font-weight: 800;
    color: #0f172a;
}

.hero-subtitle {
    margin: 0;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.9;
    max-width: 820px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-badge {
    font-size: 12px;
    padding: 8px 14px;
}

/* ===========================
   Cards
   =========================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    background: var(--surface);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px 12px;
    font-weight: 800;
    font-size: 16px;
    border-radius: 18px 18px 0 0 !important;
}

.card-body {
    padding: 20px;
}

.dashboard-card .card-header {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.filter-card {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.search-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-block {
    flex: 1 1 420px;
}

.toolbar-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}

.search-group {
    max-width: 560px;
}

.toolbar-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mini-stat {
    min-width: 110px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    padding: 10px 14px;
}

.mini-stat span {
    display: block;
    color: var(--secondary);
    font-size: 11px;
    margin-bottom: 4px;
}

.mini-stat strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

/* Dashboard stat cards */
.stat-card {
    border-radius: 18px;
    padding: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    top: 12px;
    font-size: 40px;
    opacity: 0.2;
}

[dir="ltr"] .stat-card .stat-icon { right: 16px; }
[dir="rtl"] .stat-card .stat-icon { left: 16px; }

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.bg-stat-1 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.bg-stat-2 { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.bg-stat-3 { background: linear-gradient(135deg, #d97706, #f59e0b); }
.bg-stat-4 { background: linear-gradient(135deg, #dc2626, #ef4444); }
.bg-stat-5 { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

/* ===========================
   Tables
   =========================== */
.table {
    font-size: 13px;
}

.table thead th {
    background: #fbfdff;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: #5f6368;
    font-size: 12px;
    padding: 10px 12px;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table-hover tbody tr:hover {
    background: var(--primary-light);
}

.modern-table thead th {
    background: #fbfdff;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.modern-table tbody td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.table-primary-text {
    font-weight: 800;
    color: #0f172a;
}

.table-secondary-text {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 2px;
}

.soft-id {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

/* ===========================
   Buttons
   =========================== */
.btn { border-radius: 6px; font-size: 13px; font-weight: 500; }
.btn { border-radius: 12px; font-size: 13px; font-weight: 700; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #14b8a6); border-color: var(--primary); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-outline-primary {
    color: var(--primary);
    border-color: #b8d8d4;
    background: #fff;
}
.btn-outline-primary:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ===========================
   Forms
   =========================== */
.form-control, .custom-select {
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    min-height: 44px;
    background: #fff;
}

.form-control:focus, .custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

label {
    font-weight: 500;
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 4px;
}

.field-validation-error {
    color: var(--danger);
    font-size: 12px;
}

.detail-value {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.detail-paragraph {
    color: #334155;
    line-height: 1.9;
}

/* ===========================
   Alerts
   =========================== */
.alert {
    border-radius: 14px;
    font-size: 13px;
    border: none;
    padding: 12px 16px;
}

.alert-success { background: #e6f4ea; color: #0d904f; }
.alert-danger { background: #fce8e6; color: #d93025; }
.alert-warning { background: #fef7e0; color: #b06000; }
.alert-info { background: #e8f0fe; color: #1a73e8; }

/* ===========================
   Status badges
   =========================== */
.badge-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.summary-stack {
    display: grid;
    gap: 10px;
}

.summary-item-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fbff;
    border: 1px solid #e4edf7;
    border-radius: 14px;
}

.summary-item-modern span {
    color: var(--secondary);
    font-size: 13px;
}

.summary-item-modern strong {
    color: #0f172a;
    font-size: 18px;
}

.soft-info-box {
    padding: 14px;
    border: 1px dashed #b9d7ff;
    border-radius: 14px;
    background: #f8fbff;
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.8;
}

.badge-inquiry { background: #e8f0fe; color: #1a73e8; }
.badge-submitted { background: #fef7e0; color: #b06000; }
.badge-processing { background: #fff3e0; color: #e65100; }
.badge-conditional { background: #f3e5f5; color: #7b1fa2; }
.badge-confirmed { background: #e6f4ea; color: #0d904f; }
.badge-completed { background: #e0f2f1; color: #00695c; }
.badge-cancelled { background: #fce8e6; color: #d93025; }

/* ===========================
   Pagination
   =========================== */
.pagination .page-link {
    color: var(--primary);
    border-color: var(--border-color);
    font-size: 13px;
    padding: 6px 12px;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===========================
   Overlay (mobile sidebar)
   =========================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.sidebar-overlay.show { display: block; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0) !important;
    }

    .topbar {
        left: 0 !important;
        right: 0 !important;
    }

    .topbar-page-meta {
        display: none;
    }

    .topbar .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .hero-title {
        font-size: 28px;
    }
}

@media (max-width: 575.98px) {
    .login-box {
        padding: 28px 20px;
    }

    .login-shell-brand {
        position: static;
        padding: 16px;
        margin-bottom: 8px;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

/* ===========================
   Scrollbar
   =========================== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

/* ===========================
   Utility
   =========================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

/* ===========================
   RTL Normalization
   Keep Arabic visually equal to English
   =========================== */
[dir="rtl"] body,
[dir="rtl"] .card,
[dir="rtl"] .login-box,
[dir="rtl"] .table,
[dir="rtl"] .form-control,
[dir="rtl"] .custom-select,
[dir="rtl"] .btn,
[dir="rtl"] .alert,
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .topbar-right,
[dir="rtl"] .topbar-left,
[dir="rtl"] .page-header,
[dir="rtl"] .sidebar-brand,
[dir="rtl"] .topbar-user,
[dir="rtl"] .lang-switch,
[dir="rtl"] .login-shell-brand,
[dir="rtl"] .login-feature-list div {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-menu li a,
[dir="rtl"] .dropdown-item,
[dir="rtl"] .btn,
[dir="rtl"] .alert {
    text-align: right;
}

[dir="rtl"] .input-group > .form-control:not(:last-child),
[dir="rtl"] .input-group > .custom-select:not(:last-child) {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

[dir="rtl"] .input-group > .input-group-append > .btn,
[dir="rtl"] .input-group > .input-group-append > .input-group-text {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

[dir="rtl"] .mr-1,
[dir="rtl"] .mr-2 {
    margin-right: 0 !important;
}

[dir="rtl"] .mr-1 { margin-left: .25rem !important; }
[dir="rtl"] .mr-2 { margin-left: .5rem !important; }

[dir="rtl"] .ml-2 {
    margin-left: 0 !important;
    margin-right: .5rem !important;
}

[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }

[dir="rtl"] .close {
    float: left;
}

[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

[dir="rtl"] .pagination {
    padding-right: 0;
}

[dir="rtl"] .custom-control,
[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] .form-check-input,
[dir="rtl"] .custom-control-input {
    margin-left: 0;
}

[dir="rtl"] .form-check-input {
    margin-right: -1.5rem;
}
