:root {
    --bg: #07111f;
    --bg-soft: #0d1b2f;
    --card: rgba(15, 27, 47, 0.72);
    --card-2: rgba(255, 255, 255, 0.06);
    --stroke: rgba(255, 255, 255, 0.12);
    --text: #f7fbff;
    --muted: #9fb3c8;
    --primary: #7c5cff;
    --primary-2: #16c2ff;
    --success: #20d7a4;
    --warning: #ffb648;
    --danger: #ff5d8f;
    --shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124,92,255,0.28), transparent 28%),
        radial-gradient(circle at bottom right, rgba(22,194,255,0.22), transparent 32%),
        linear-gradient(135deg, #06101d 0%, #081321 35%, #0b1730 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

.glass-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.login-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 35px 35px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.55;
}
.orb-one { width: 280px; height: 280px; background: #6f59ff; top: 7%; right: 6%; }
.orb-two { width: 320px; height: 320px; background: #0ec7ff; bottom: 5%; left: 5%; }

.login-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    position: relative;
    z-index: 2;
}

.brand-card, .login-card, .sidebar, .hero-card, .stat-card, .form-card, .table-card, .inner-card, .profile-details, .receipts-panel, .uploads-section {
    border-radius: var(--radius-xl);
}

.brand-card, .login-card { padding: 34px; }
.logo-wrap, .brand-logo-lg {
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo-mark {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 38px;
    font-weight: 900;
    box-shadow: 0 18px 35px rgba(61, 124, 255, 0.35);
}
.logo-mark.small { width: 58px; height: 58px; font-size: 28px; border-radius: 18px; }
.brand-card h1, .brand-logo-lg h2 { margin: 0 0 6px; }
.brand-card p, .brand-logo-lg p, .hero-content p, .login-card-head p { color: var(--muted); margin: 0; }
.feature-list {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.feature-list > div, .detail-box, .receipt-item, .client-meta div {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
}
.feature-list > div {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.feature-list i, .stat-icon i { font-size: 20px; }
.login-card-head { margin-bottom: 22px; }
.login-card-head h2 { margin: 10px 0 6px; font-size: 34px; }
.mini-badge {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: rgba(124, 92, 255, 0.18);
    color: #ddd8ff;
    border: 1px solid rgba(124, 92, 255, 0.28);
}
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 14px; color: #d8e2ee; font-weight: 700; }
.input-icon-wrap { position: relative; }
.input-icon-wrap i {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #aac4dd;
}
input, select, textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 16px;
    padding: 16px 18px;
    outline: none;
    transition: .25s ease;
}
.input-icon-wrap input { padding-right: 48px; }
input:focus, select:focus, textarea:focus {
    border-color: rgba(124, 92, 255, 0.65);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
    transform: translateY(-1px);
}
textarea { resize: vertical; min-height: 130px; }
.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 20px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 16px 28px rgba(85, 103, 255, 0.28);
}
.btn-secondary {
    color: white;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-block { width: 100%; }
.btn-lg { padding: 18px 22px; font-size: 16px; }
.btn-sm { padding: 10px 14px; font-size: 13px; }
.alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin: 16px 0;
    font-weight: 700;
}
.alert-success { background: rgba(32,215,164,0.14); border: 1px solid rgba(32,215,164,0.3); color: #baffea; }
.alert-danger { background: rgba(255,93,143,0.14); border: 1px solid rgba(255,93,143,0.3); color: #ffd8e6; }

.app-shell {
    display: grid;
    grid-template-columns: 295px minmax(0,1fr);
    gap: 22px;
    padding: 24px;
}
.sidebar {
    padding: 22px;
    min-height: calc(100vh - 48px);
    position: sticky;
    top: 24px;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 26px;
}
.sidebar-nav a {
    padding: 14px 16px;
    border-radius: 18px;
    color: #dbe7f3;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    transition: .22s ease;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(22,194,255,0.13));
    border-color: rgba(255,255,255,0.1);
    transform: translateX(-4px);
}
.sidebar-foot { margin-top: auto; padding-top: 22px; }
.pulse-box {
    display: flex; align-items: center; gap: 10px;
    color: #cce9de; background: rgba(32,215,164,0.08);
    border: 1px solid rgba(32,215,164,0.18);
    border-radius: 16px; padding: 14px 16px;
}
.pulse-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--success); box-shadow: 0 0 0 8px rgba(32,215,164,0.1);
}
.main-content { min-width: 0; }
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.compact-hero { padding: 24px 28px; }
.hero-content h1 { margin: 12px 0 10px; font-size: clamp(30px, 4vw, 44px); line-height: 1.12; }
.hero-shapes .shape {
    position: absolute; border-radius: 50%; filter: blur(0px);
    background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(22,194,255,0.08));
    border: 1px solid rgba(255,255,255,0.08);
}
.shape.one { width: 170px; height: 170px; top: -34px; left: 8%; }
.shape.two { width: 110px; height: 110px; bottom: -12px; left: 30%; }
.shape.three { width: 230px; height: 230px; top: 5px; left: -50px; opacity: .55; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 22px 0;
}
.three-col { grid-template-columns: repeat(3, 1fr); }
.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.glow-card::before {
    content: '';
    position: absolute; inset: auto -60px -60px auto;
    width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124,92,255,0.25), transparent 60%);
}
.stat-icon {
    width: 58px; height: 58px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(22,194,255,0.18));
    border: 1px solid rgba(255,255,255,0.1);
}
.stat-label { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.stat-value { font-size: clamp(22px, 3vw, 30px); font-weight: 900; }
.stat-subline { margin-top: 8px; color: #a9bbd0; font-size: 12px; line-height: 1.8; }
.small-value { font-size: 18px; display: flex; flex-direction: column; gap: 6px; }
.small-value small { color: var(--muted); font-size: 12px; font-weight: 700; }

.content-grid, .profile-layout {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 22px;
}
.form-card, .table-card, .profile-details, .receipts-panel, .uploads-section { padding: 24px; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px;
}
.section-head h3 { margin: 8px 0 0; font-size: 24px; }
.between { align-items: flex-start; }
.client-form-grid, .sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.full-width { grid-column: 1 / -1; }
.hidden-block { display: none; }
.checkbox-wrap { justify-content: end; }
.toggle-check {
    display: flex; align-items: flex-start; gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 16px; border-radius: 18px;
    color: #d9e6f2; font-weight: 700;
}
.toggle-check input { width: 18px; height: 18px; margin-top: 3px; }

.clients-grid, .file-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.client-card, .file-preview-card { padding: 18px; }
.client-card-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 16px;
}
.client-card-head h4, .file-card-body h4 { margin: 0 0 6px; font-size: 22px; }
.client-card-head p, .file-card-body p { margin: 0; color: var(--muted); }
.pill {
    display: inline-flex; padding: 8px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 800;
}
.pill.success { background: rgba(32,215,164,0.14); color: #baf6e3; }
.pill.dark { background: rgba(255,255,255,0.08); color: #eef5ff; }
.client-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.client-meta div {
    padding: 12px 14px;
    color: #dbe7f3;
    display: flex; align-items: center; gap: 10px;
}
.card-actions { margin-top: 18px; display: flex; gap: 10px; }
.empty-state, .empty-mini {
    text-align: center;
    padding: 34px 18px;
    color: var(--muted);
    border-radius: 24px;
    border: 1px dashed rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.03);
}
.empty-state i { font-size: 42px; margin-bottom: 12px; color: #8eb6db; }
.wide-empty { grid-column: 1 / -1; }

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.detail-box { padding: 18px; }
.detail-box span {
    display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.detail-box strong { font-size: 17px; color: #f5fbff; line-height: 1.8; }
.detail-box.full { grid-column: 1 / -1; }
.collect-form { margin-top: 18px; }
.receipts-list { display: flex; flex-direction: column; gap: 12px; }
.receipt-item {
    padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.receipt-item strong { font-size: 20px; }
.receipt-item p { margin: 6px 0 0; color: var(--muted); }
.receipt-item span { color: #cfddee; font-size: 13px; }
.upload-inline-form {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.file-input-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px 18px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 800;
}
.file-input-btn input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.file-preview-box {
    aspect-ratio: 16 / 10;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(22,194,255,0.12));
    border: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
}
.file-preview-box img, .file-preview-box video { width: 100%; height: 100%; object-fit: cover; }
.doc-preview-icon { font-size: 54px; color: white; }
.file-card-body { padding-top: 16px; }

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid, .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .login-shell, .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; min-height: auto; }
    .clients-grid, .file-showcase-grid, .client-form-grid, .sub-grid, .details-grid, .feature-list, .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .app-shell, .login-page { padding: 14px; }
    .brand-card, .login-card, .sidebar, .hero-card, .form-card, .table-card, .profile-details, .receipts-panel, .uploads-section { padding: 18px; }
    .hero-content h1 { font-size: 28px; }
    .stats-grid { grid-template-columns: 1fr; }
    .client-card-head { flex-direction: column; }
    .receipt-item { flex-direction: column; align-items: flex-start; }
    .upload-inline-form { flex-direction: column; align-items: stretch; }
}
