/* =========================================================
   سطر تكنولوجي — نظام التصميم الحديث (Glassmorphism) v2
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary-light: #38bdf8;
    --primary: #0077b6;
    --primary-dark: #023e8a;
    --primary-darker: #03045e;

    --violet: #8b5cf6;
    --pink: #f472b6;
    --mint: #34d399;

    --bg-gradient-1: #e0f2fe;
    --bg-gradient-2: #ede9fe;
    --bg-gradient-3: #fce7f3;

    --surface-1: rgba(255, 255, 255, 0.72);
    --surface-2: rgba(255, 255, 255, 0.52);
    --surface-border: rgba(255, 255, 255, 0.7);
    --surface-border-soft: rgba(148, 163, 184, 0.18);

    --text-main: #0f172a;
    --text-muted: #64748b;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;

    --bg-color: #eef2fb;
    --border-color: rgba(148, 163, 184, 0.25);

    --glass-blur: 18px;

    --sidebar-width: 276px;
    --header-height: 68px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 26px 60px -18px rgba(15, 23, 42, 0.28);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Tajawal', sans-serif; }

body {
    min-height: 100vh;
    position: relative;
    color: var(--text-main);
    direction: rtl;
    line-height: 1.7;
    background-color: #eef2fb;
    background-image:
        radial-gradient(at 12% 8%, #dbeafe 0px, transparent 46%),
        radial-gradient(at 100% 0%, #fae8ff 0px, transparent 40%),
        radial-gradient(at 88% 96%, #cffafe 0px, transparent 44%),
        radial-gradient(at 4% 92%, #fde68a 0px, transparent 36%);
    background-attachment: fixed;
    overflow-x: hidden;
}

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--violet); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-18px) translateX(10px); } }
@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.animate-fade-up { animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ===== LAYOUT ===== */
.app-container { display: flex; min-height: 100vh; width: 100%; overflow-x: hidden; position: relative; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 14px;
    right: 14px;
    bottom: 14px;
    height: calc(100vh - 28px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(165deg, rgba(2, 31, 72, 0.92), rgba(2, 62, 138, 0.9) 55%, rgba(3, 4, 94, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px -20px rgba(3, 4, 94, 0.55);
    transition: var(--transition);
}
.sidebar::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 70%);
    border-radius: 50%;
    animation: float 9s ease-in-out infinite;
}
.sidebar-header {
    position: relative;
    z-index: 1;
    padding: 22px 22px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 19px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--violet));
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
    flex-shrink: 0;
}
.sidebar-header h2 { font-size: 20px; font-weight: 900; letter-spacing: 0.5px; color: #fff; line-height: 1.2; }
.sidebar-header h2 span { background: linear-gradient(90deg, #7dd3fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-header p { font-size: 11px; color: rgba(255, 255, 255, 0.55); font-weight: 500; }

.sidebar-menu { position: relative; z-index: 1; padding: 10px 14px 14px; list-style: none; flex: 1; overflow-y: auto; }
.menu-group-label {
    padding: 14px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.45);
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin: 2px 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.sidebar-menu li a i { font-size: 15px; width: 20px; text-align: center; opacity: 0.9; }
.sidebar-menu li a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; transform: translateX(-3px); }
.sidebar-menu li a.active {
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.28), rgba(139, 92, 246, 0.22));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 60%;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
}
.sidebar-footer { position: relative; z-index: 1; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 12px;
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.8);
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}
.logout-btn i { width: 20px; text-align: center; font-size: 15px; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }

/* ===== MOBILE TOGGLE ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1060;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--primary-darker);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--primary); color: #fff; transform: scale(1.05); }
.sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    z-index: 1030;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; margin-right: calc(var(--sidebar-width) + 28px); min-height: 100vh; display: flex; flex-direction: column; width: calc(100% - var(--sidebar-width) - 28px); min-width: 0; }

/* ===== HEADER ===== */
.top-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 14px;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    margin: 14px 14px 6px;
}
.top-header h3.current-page { font-size: 16px; font-weight: 800; color: var(--primary-darker); }
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: var(--transition);
}
.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
    object-fit: cover;
}
.user-info { text-align: left; line-height: 1.3; }
.user-info h4 { font-size: 13px; font-weight: 800; color: var(--text-main); }
.user-info p { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10.5px;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--primary-dark);
    margin-top: 2px;
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 16px 22px 40px; flex: 1; animation: fadeIn 0.4s ease; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-title { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.page-title h1 { font-size: 24px; font-weight: 900; letter-spacing: -0.3px; color: var(--primary-darker); }

/* ===== GLASS CARD ===== */
.card {
    background: var(--surface-1);
    -webkit-backdrop-filter: blur(var(--glass-width));
    backdrop-filter: blur(var(--glass-width));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 22px;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease both;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-darker);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--surface-border-soft);
}
.card-title > span { display: inline-flex; align-items: center; gap: 8px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    white-space: nowrap;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}
.btn:active::after { animation: ripple 0.6s ease; opacity: 1; }
@keyframes ripple { to { width: 320px; height: 320px; } }
.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(2, 62, 138, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(2, 62, 138, 0.7); color: #fff; }
.btn-outline {
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    color: var(--primary-dark);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.btn-outline:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
.btn-danger { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; box-shadow: 0 8px 20px -8px rgba(239, 68, 68, 0.6); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(239, 68, 68, 0.6); }
.btn-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.6); }
.btn-success:hover { transform: translateY(-2px); }
.btn-warning { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; box-shadow: 0 8px 20px -8px rgba(245, 158, 11, 0.6); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 10px; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--primary-darker);
    background: rgba(224, 242, 254, 0.6);
    border-bottom: 1px solid var(--surface-border-soft);
    white-space: nowrap;
}
thead th:first-child { border-radius: 0 12px 0 0; }
thead th:last-child { border-radius: 12px 0 0 0; }
tbody td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--surface-border-soft); font-size: 13.5px; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(56, 189, 248, 0.05); }
tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.badge-success { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-warning { background: rgba(245, 158, 11, 0.14); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.28); }
.badge-danger { background: rgba(239, 68, 68, 0.13); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-info { background: rgba(56, 189, 248, 0.15); color: #0369a1; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-primary { background: rgba(139, 92, 246, 0.14); color: #6d28d9; border: 1px solid rgba(139, 92, 246, 0.28); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 7px; font-weight: 700; color: var(--text-main); font-size: 13.5px; }
.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--surface-border-soft);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
    color: var(--text-main);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 15px center; padding-left: 38px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 14px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-bottom: 26px; }
.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--surface-1);
    -webkit-backdrop-filter: blur(var(--glass-width));
    backdrop-filter: blur(var(--glass-width));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    animation: fadeInUp 0.6s ease both;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -40px; left: -40px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
    opacity: 0.6;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 58px; height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stat-card:hover .stat-icon { transform: rotate(-8deg) scale(1.12); }
.stat-icon.primary { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.stat-icon.success { background: linear-gradient(135deg, #34d399, #10b981); }
.stat-icon.warning { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.stat-icon.info { background: linear-gradient(135deg, #818cf8, #6366f1); }
.stat-icon.danger { background: linear-gradient(135deg, #f87171, #ef4444); }
.stat-details h3 { font-size: 26px; font-weight: 900; color: var(--text-main); line-height: 1.15; letter-spacing: -0.5px; }
.stat-details p { color: var(--text-muted); font-size: 13px; font-weight: 600; margin-top: 2px; }

/* ===== WELCOME / HERO ===== */
.welcome-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 30px 34px;
    margin-bottom: 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-darker), var(--primary-dark) 45%, var(--violet));
    background-size: 180% 180%;
    animation: gradientMove 9s ease infinite, fadeInUp 0.5s ease both;
    box-shadow: 0 20px 45px -15px rgba(2, 62, 138, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.welcome-card::before,
.welcome-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
}
.welcome-card::before { top: -60px; right: -40px; width: 220px; height: 220px; animation: float 7s ease-in-out infinite; }
.welcome-card::after { bottom: -70px; left: -30px; width: 240px; height: 240px; background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%); animation: float 9s ease-in-out infinite reverse; }
.welcome-card h2 { position: relative; z-index: 1; font-size: 24px; font-weight: 900; margin-bottom: 6px; letter-spacing: 0.3px; }
.welcome-card p { position: relative; z-index: 1; opacity: 0.92; font-size: 14.5px; font-weight: 500; max-width: 640px; }

/* ===== DETAIL GRID ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 22px; }
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--surface-border-soft);
    backdrop-filter: blur(8px);
}
.detail-item .detail-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.15);
    flex-shrink: 0;
}
.detail-item .detail-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 2px; font-weight: 600; }
.detail-item .detail-value { font-size: 14.5px; font-weight: 800; color: var(--text-main); }

/* ===== VOTING ===== */
.vote-options { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.vote-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px;
    border-radius: 14px;
    border: 1.5px solid var(--surface-border-soft);
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}
.vote-btn:hover { border-color: var(--primary-light); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.vote-btn.selected { border-color: var(--primary); background: rgba(56, 189, 248, 0.12); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12); }
.vote-btn input[type="radio"] { display: none; }
.vote-btn i { font-size: 26px; display: block; margin-bottom: 6px; }
.vote-btn span { font-size: 13.5px; font-weight: 800; }
.vote-btn.approve i { color: var(--success); }
.vote-btn.reject i { color: var(--danger); }
.vote-btn.abstain i { color: var(--warning); }
.vote-progress { display: flex; gap: 3px; height: 10px; border-radius: var(--radius-pill); overflow: hidden; margin: 12px 0; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--surface-border-soft); }
.vote-progress .bar { height: 100%; transition: width 0.6s ease; }
.vote-progress .bar.approve { background: linear-gradient(90deg, #34d399, #10b981); }
.vote-progress .bar.reject { background: linear-gradient(90deg, #f87171, #ef4444); }
.vote-progress .bar.abstain { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.vote-summary { display: flex; gap: 22px; flex-wrap: wrap; margin: 10px 0; }
.vote-summary-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.vote-summary-item .dot { width: 11px; height: 11px; border-radius: 50%; }

/* ===== FINANCIAL SUMMARY ===== */
.financial-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.fin-item {
    position: relative;
    text-align: center;
    padding: 20px 14px;
    border-radius: 16px;
    background: var(--surface-1);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.fin-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.fin-item .fin-value { font-size: 21px; font-weight: 900; margin-bottom: 2px; color: var(--text-main); }
.fin-item .fin-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ===== AUTH ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 15% 10%, #dbeafe 0px, transparent 55%),
        radial-gradient(900px 500px at 90% 15%, #fae8ff 0px, transparent 50%),
        radial-gradient(1000px 700px at 70% 95%, #cffafe 0px, transparent 55%),
        #eef2fb;
}
.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
}
.auth-container::before { width: 480px; height: 480px; top: -140px; right: -120px; background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%); animation: float 9s ease-in-out infinite; }
.auth-container::after { width: 420px; height: 420px; bottom: -120px; left: -110px; background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%); animation: float 11s ease-in-out infinite reverse; }
.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 38px 36px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--surface-border);
    box-shadow: 0 30px 70px -25px rgba(15, 23, 42, 0.35);
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--violet));
    box-shadow: 0 14px 30px -10px rgba(56, 189, 248, 0.5);
}
.auth-header h1 { color: var(--primary-darker); font-size: 27px; font-weight: 900; letter-spacing: -0.3px; }
.auth-header h1 span { background: linear-gradient(90deg, #0ea5e9, #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-header p { color: var(--text-muted); font-size: 13.5px; font-weight: 500; }
.auth-submit { width: 100%; padding: 13px; font-size: 15px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 42px 20px; color: var(--text-muted); }
.empty-state i { font-size: 46px; margin-bottom: 14px; opacity: 0.25; }
.empty-state p { font-size: 15px; font-weight: 500; }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; animation: fadeInUp 0.35s ease; }
.alert-success { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
.alert-error { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.25); }

/* ===== PARTNER PROFILE ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 22px;
    background: var(--surface-1);
    backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--primary-light); object-fit: cover; }
.profile-info h2 { font-size: 21px; font-weight: 900; }
.profile-info p { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.profile-stat { padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--surface-border-soft); }
.profile-stat .value { font-size: 23px; font-weight: 900; color: var(--primary); }
.profile-stat .label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ===== DELETE FORM ===== */
.delete-form { display: inline; }

/* ===== UTILITIES ===== */
.hidden { display: none; }

/* ===== EXECUTOR ROWS (dynamic forms) ===== */
.executor-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
    width: 100%;
}
.executor-row > .form-group {
    margin-bottom: 0 !important;
}
.executor-row > .form-group:nth-child(1) {
    flex: 2;
}
.executor-row > .form-group:nth-child(2) {
    flex: 1;
}
.executor-row > .btn-danger,
.executor-row > .placeholder-spacer {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== SCROLLBAR ===== */
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: var(--radius-pill); }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.35); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.5); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== RESPONSIVE ===== */

/* --- Tablet & small desktop (≤1180px) --- */
@media (max-width: 1180px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    .app-container {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden !important;
        position: relative !important;
    }
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
        transform: translateX(100%) !important;
        visibility: hidden !important;
        pointer-events: none !important;
        z-index: 1040 !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s step-end !important;
        box-shadow: -10px 0 30px rgba(2, 6, 23, 0.3) !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s step-start !important;
    }
    .sidebar-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 1060 !important;
    }
    .form-row { grid-template-columns: 1fr 1fr; }
    .top-header {
        margin: 10px 10px 6px;
        padding: 0 16px;
        padding-right: 64px;
        width: auto;
    }
    .page-content { padding: 14px 16px 30px; }
    .card { padding: 20px; }
    .card-title { font-size: 15px; flex-wrap: wrap; gap: 10px; }
    .page-title { gap: 12px; }
    .page-title h1 { font-size: 20px; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Tablet portrait & large phone (≤768px) --- */
@media (max-width: 768px) {
    .page-content { padding: 12px 12px 30px; }

    /* Form Rows - Dynamically stack fields on mobile screens */
    .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .form-row > .form-group {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 0 !important;
    }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 18px 16px; }
    .stat-icon { width: 48px; height: 48px; font-size: 20px; border-radius: 13px; }
    .stat-details h3 { font-size: 20px; }
    .stat-details p { font-size: 12px; }

    /* Detail grid */
    .detail-grid { grid-template-columns: 1fr; }

    /* Page title & actions */
    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-title h1 { font-size: 19px; }

    /* Welcome */
    .welcome-card { padding: 22px 20px; }
    .welcome-card h2 { font-size: 18px; }
    .welcome-card p { font-size: 13px; }

    /* Financial summary */
    .financial-summary { grid-template-columns: 1fr 1fr; gap: 12px; }
    .fin-item { padding: 16px 10px; }
    .fin-item .fin-value { font-size: 18px; }

    /* Cards */
    .card { padding: 18px; margin-bottom: 16px; border-radius: 18px; }
    .card-title {
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Tables */
    table { min-width: 580px; }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        border-radius: var(--radius-sm);
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Executor row (Dynamic Partner Row Styles) */
    .executor-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        background: rgba(255, 255, 255, 0.65) !important;
        padding: 16px !important;
        border-radius: var(--radius) !important;
        border: 1px solid var(--surface-border-soft) !important;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
        margin-bottom: 14px !important;
        position: relative !important;
        width: 100% !important;
    }
    .executor-row > .form-group {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 0 !important;
    }
    .executor-row > .btn-danger {
        width: 100% !important;
        height: auto !important;
        margin-top: 6px !important;
        padding: 10px 14px !important;
        border-radius: 10px !important;
        justify-content: center !important;
    }
    .executor-row > .placeholder-spacer {
        display: none !important;
    }

    /* Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 20px;
    }
    .profile-avatar { width: 64px; height: 64px; }
    .profile-info h2 { font-size: 18px; }
    .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .profile-stat { padding: 12px 8px; }
    .profile-stat .value { font-size: 18px; }

    /* Buttons */
    .btn { padding: 10px 18px; font-size: 13px; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }

    /* User profile in header */
    .user-profile img { width: 34px; height: 34px; }

    /* Vote buttons */
    .vote-options { gap: 10px; }
    .vote-btn { min-width: 100px; padding: 14px 10px; }
    .vote-btn i { font-size: 22px; }

    /* Auth card */
    .auth-card { padding: 28px 24px; }
    .auth-header h1 { font-size: 22px; }

    /* Detail items */
    .detail-item { padding: 12px; }
    .detail-item .detail-icon { width: 36px; height: 36px; font-size: 14px; }
    .detail-item .detail-value { font-size: 13px; }

    /* Alerts */
    .alert { padding: 12px 14px; font-size: 13px; }
}

/* --- Phone (≤480px) --- */
@media (max-width: 480px) {
    .page-content { padding: 10px 8px 24px; }

    /* Stats: single column */
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px 14px; gap: 14px; }
    .stat-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
    .stat-details h3 { font-size: 18px; }

    /* Vote buttons: vertical stack */
    .vote-options { flex-direction: column; }
    .vote-btn { min-width: auto; }

    /* Profile stats */
    .profile-stats { grid-template-columns: 1fr; }

    /* Financial summary: single column */
    .financial-summary { grid-template-columns: 1fr; }

    /* User info hidden, show avatar only */
    .user-info { display: none; }

    /* Top header */
    .top-header { height: 56px; padding: 0 12px; padding-right: 58px; margin: 8px 8px 6px; }

    /* Page title */
    .page-title h1 { font-size: 17px; }

    /* Cards */
    .card { padding: 14px; border-radius: 14px; }
    .card-title { font-size: 13px; padding-bottom: 10px; margin-bottom: 12px; }

    /* Welcome */
    .welcome-card { padding: 18px 16px; }
    .welcome-card h2 { font-size: 16px; }
    .welcome-card p { font-size: 12px; }

    /* Tables - allow scroll */
    table { min-width: 520px; }
    thead th { padding: 10px 12px; font-size: 11px; }
    tbody td { padding: 10px 12px; font-size: 12.5px; }

    /* Buttons */
    .btn { padding: 9px 14px; font-size: 12.5px; gap: 6px; border-radius: 10px; }
    .btn-sm { padding: 5px 10px; font-size: 11.5px; }

    /* Auth */
    .auth-card { padding: 24px 18px; border-radius: 18px; }
    .auth-logo { width: 52px; height: 52px; font-size: 22px; }
    .auth-header h1 { font-size: 20px; }
    .auth-header p { font-size: 12px; }
    .auth-submit { padding: 12px; font-size: 14px; }

    /* Profile */
    .profile-header { padding: 16px; }
    .profile-avatar { width: 56px; height: 56px; }
    .profile-info h2 { font-size: 16px; }
    .profile-info p { font-size: 12px; }

    /* Detail items */
    .detail-item { padding: 10px; gap: 10px; }
    .detail-item .detail-icon { width: 32px; height: 32px; font-size: 13px; border-radius: 10px; }

    /* Badges smaller */
    .badge { padding: 3px 9px; font-size: 10.5px; }

    /* Financial items */
    .fin-item { padding: 14px 10px; border-radius: 12px; }
    .fin-item .fin-value { font-size: 17px; }
    .fin-item .fin-label { font-size: 11px; }

    /* Alerts */
    .alert { padding: 10px 12px; font-size: 12.5px; border-radius: 12px; }

    /* Forms */
    .form-control { padding: 10px 13px; font-size: 13px; }
    .form-label { font-size: 12.5px; }
    select.form-control { padding-left: 32px; }
}