/* ======================================
   Prince VIP System - Main Stylesheet
   نظام برنس VIP - ملف التنسيقات الرئيسي
   ====================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary: #DAA520;
    --primary-dark: #B8860B;
    --primary-light: #FFD700;
    --primary-gradient: linear-gradient(135deg, #DAA520, #FFD700);
    --sidebar-bg: #FAF3E0;
    --sidebar-hover: #F0E4C8;
    --sidebar-active: #DAA520;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --border-color: #e9ecef;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;

    /* RGB decomposed for rgba() usage */
    --primary-rgb: 218, 165, 32;

    /* Login page dark theme */
    --login-bg: #1a1a2e;
    --login-bg-mid: #16213e;
    --login-bg-accent: #0f3460;
    --login-bg-rgb: 26, 26, 46;
}

/* Override Bootstrap defaults to gold */
.text-primary { color: var(--primary) !important; }

/* Nav tabs gold */
.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active:focus,
.nav-tabs .nav-link.active:hover {
    color: var(--primary) !important;
    border-bottom: 3px solid var(--primary);
    font-weight: 700;
    background: transparent;
}
.nav-tabs .nav-link { color: var(--text-dark); font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--primary); border-bottom: 3px solid var(--primary-light); }

/* Links & focus */
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(218,165,32,0.25);
}
.btn-primary {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.bg-primary { background: var(--primary) !important; }

/* Page headings gold bold */
h4, h5 { font-weight: 700; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    direction: rtl;
    min-height: 100vh;
    font-size: 14px;
    overflow-x: hidden;
}

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* ======= LOGIN PAGE ======= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f0e1 0%, #faf6eb 40%, #f0ead6 70%, #faf3e0 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--primary-rgb),0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    border-radius: 50%;
    animation: floatGlow 12s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--primary-rgb),0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: floatGlow 15s ease-in-out infinite reverse;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(var(--primary-rgb),0.25), rgba(var(--primary-rgb),0.08));
    border: 1px solid rgba(var(--primary-rgb),0.2);
    animation: riseBubble linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes riseBubble {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-110vh) scale(0.5);
        opacity: 0;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 45px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
}

/* Moving animated border */
.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    background: conic-gradient(
        from var(--border-angle, 0deg),
        transparent 0%,
        rgba(var(--primary-rgb), 0.3) 8%,
        var(--primary) 15%,
        var(--primary-light) 22%,
        rgba(var(--primary-rgb), 0.3) 30%,
        transparent 40%,
        transparent 60%,
        rgba(var(--primary-rgb), 0.3) 70%,
        var(--primary) 78%,
        var(--primary-light) 85%,
        rgba(var(--primary-rgb), 0.3) 92%,
        transparent 100%
    );
    z-index: -1;
    animation: rotateBorder 6s linear infinite;
}

.login-card::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.95);
    z-index: -1;
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

/* Fallback for browsers without @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .login-card {
        border: 2px solid rgba(var(--primary-rgb),0.3);
    }
    .login-card::before, .login-card::after {
        display: none;
    }
}

.login-logo {
    width: 140px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 12px rgba(var(--primary-rgb),0.2));
}

.login-title {
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 1.7rem;
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.login-card .form-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.login-card .input-group {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
}

.login-card .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
    background: #fff;
}

.login-card .input-group-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    padding: 12px 15px;
}

.login-card .form-control {
    border: none;
    padding: 12px 10px;
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-dark);
}

.login-card .form-control::placeholder {
    color: var(--text-muted);
}

.login-card .form-control:focus {
    box-shadow: none;
    color: var(--text-dark);
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius);
    padding: 13px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    width: 100%;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb),0.3);
    color: #fff;
}

.login-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--text-muted);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.login-close:hover {
    background: var(--danger);
    color: #fff;
}

.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    z-index: 1;
}

.login-footer a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

/* ======= SIDEBAR ======= */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0,0,0,0.08);
    border-left: 1px solid #E8DAB2;
}

.sidebar-brand {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #E8DAB2;
}

.sidebar-brand img {
    width: 70px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-brand h5 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.sidebar-brand small {
    color: #8B7D6B;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-section {
    padding: 15px 15px 5px;
    color: #A0926B;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 3px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    color: #4A4031;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: #B8860B;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(218,165,32,0.25), rgba(218,165,32,0.1));
    color: #B8860B;
    font-weight: 700;
    border-right: 3px solid var(--primary);
}

.sidebar-menu a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-menu .badge {
    margin-right: auto;
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* ======= SIDEBAR SUB-MENUS ======= */
.sidebar-submenu-section {
    margin: 0;
}

.sidebar-submenu-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    margin: 0 10px 3px;
    color: #A0926B;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.sidebar-submenu-toggle:hover {
    background: var(--sidebar-hover);
    color: #B8860B;
}

.sidebar-submenu-toggle.open {
    color: #B8860B;
}

.sidebar-submenu-toggle i:first-child {
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.sidebar-submenu-toggle .sidebar-chevron {
    margin-right: auto;
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.sidebar-submenu-toggle.open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    padding-right: 12px;
}

.sidebar-submenu .sidebar-divider {
    border-top: 1px dashed #E8DAB2;
    margin: 6px 15px;
    list-style: none;
}

.sidebar-submenu.show {
    display: block;
}

.sidebar-submenu a {
    padding: 8px 15px 8px 15px;
    font-size: 0.85rem;
}

/* ======= TOP NAVBAR ======= */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 260px;
    height: 65px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 999;
}

.navbar-search {
    position: relative;
    width: 350px;
}

.navbar-search input {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 8px 45px 8px 20px;
    font-family: 'Tajawal';
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--body-bg);
}

.navbar-search input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(218,165,32,0.1);
}

.navbar-search .search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* DateTime Box */
.datetime-box {
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    gap: 8px;
    cursor: default;
    margin-inline-end: 2px;
}
.datetime-icon {
    color: #fff;
    font-size: 1rem;
    opacity: 0.85;
}
.datetime-text {
    line-height: 1.15;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.datetime-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.datetime-date {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.8);
}

.navbar-actions .nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: none;
    text-decoration: none;
}

.navbar-actions .nav-icon:hover {
    background: var(--primary);
    color: #fff;
}

.navbar-actions .nav-icon .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.6rem;
    padding: 2px 5px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ======= MAIN CONTENT ======= */
.main-content {
    margin-right: 260px;
    margin-top: 65px;
    padding: 25px;
    min-height: calc(100vh - 65px);
    overflow-x: hidden;
    max-width: 100vw;
}

/* ======= WELCOME BANNER ======= */
.welcome-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius);
    padding: 30px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    left: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(218,165,32,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.welcome-text p {
    opacity: 0.7;
    font-size: 0.9rem;
    margin: 0;
}

.welcome-actions {
    display: flex;
    gap: 10px;
    z-index: 1;
}

.welcome-actions .btn {
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

/* ======= STAT CARDS ======= */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    font-size: 1.3rem;
    margin-bottom: 3px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 5px 0;
}

.stat-card .stat-detail {
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-card .stat-detail.text-success { color: var(--success) !important; }
.stat-card .stat-detail.text-primary { color: var(--primary) !important; }
.stat-card .stat-detail.text-info { color: var(--info) !important; }
.stat-card .stat-detail.text-warning { color: var(--warning) !important; }

/* ======= CARDS GENERAL ======= */
.content-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.content-card .card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card .card-header h5 {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-card .card-body {
    padding: 22px;
}

/* ======= DATA TABLE ======= */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: var(--body-bg);
    padding: 12px 15px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(218,165,32,0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ======= STATUS BADGES ======= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-badge.draft { background: #f0f0f0; color: #666; }
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.rejected { background: #f8d7da; color: #721c24; }
.status-badge.expired { background: #e2e3e5; color: #383d41; }
.status-badge.hot { background: #dc3545; color: #fff; }
.status-badge.warm { background: var(--primary); color: #fff; }
.status-badge.cold { background: #6c757d; color: #fff; }

/* ======= BUTTONS ======= */
.btn-gold {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(218,165,32,0.3);
    color: #fff;
}

.btn-outline-gold {
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    background: transparent;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-outline-gold:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm-action {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    transition: var(--transition);
    cursor: pointer;
}

/* ======= FORM STYLES ======= */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.form-group label .required {
    color: var(--danger);
    margin-right: 3px;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    font-family: 'Tajawal';
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(218,165,32,0.1);
}

.form-section-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-dark);
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======= UPLOAD FILE ======= */
.file-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--body-bg);
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: rgba(218,165,32,0.05);
}

.file-upload-box i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.file-upload-box p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ======= UPLOAD PROGRESS OVERLAY ======= */
.upload-progress-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}
.upload-progress-overlay.show {
    opacity: 1;
}
.upload-progress-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 35px 45px;
    text-align: center;
    min-width: 340px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: uploadCardIn 0.4s ease;
}
@keyframes uploadCardIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.upload-progress-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
    animation: uploadBounce 1.2s ease infinite;
}
@keyframes uploadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.upload-progress-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 18px;
}
.upload-progress-bar-wrap {
    background: var(--border-color);
    border-radius: 20px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 20px;
    transition: width 0.25s ease;
    position: relative;
}
.upload-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: uploadShimmer 1.5s ease infinite;
}
@keyframes uploadShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.upload-progress-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ======= ATTACHMENT GRID ======= */
.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.attach-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    transition: var(--transition);
    position: relative;
}
.attach-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.attach-card .attach-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
    overflow: hidden;
    cursor: pointer;
}
.attach-card .attach-preview img {
    display: none; /* Always show icon, not image thumbnail */
}
.attach-card .attach-preview .file-icon {
    font-size: 2.5rem;
}
.attach-card .file-icon.icon-pdf { color: #e74c3c; }
.attach-card .file-icon.icon-word { color: #2b5797; }
.attach-card .file-icon.icon-excel { color: #217346; }
.attach-card .file-icon.icon-text { color: #7f8c8d; }
.attach-card .file-icon.icon-image { color: var(--primary); }
.attach-card .file-icon.icon-default { color: #95a5a6; }
.attach-card .attach-info {
    padding: 6px 8px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.attach-card .attach-info .attach-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.attach-card .attach-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}
.attach-card .attach-actions .btn {
    padding: 2px 8px;
    font-size: 0.72rem;
}
.attach-card .file-source-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    z-index: 2;
}
/* Mobile: compact grid */
@media (max-width: 576px) {
    .attach-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .attach-card .attach-preview { height: 65px; }
    .attach-card .attach-preview .file-icon { font-size: 2rem; }
    .attach-card .attach-info { padding: 4px 5px; }
    .attach-card .attach-info .attach-title { font-size: 0.65rem; }
    .attach-card .attach-actions .btn { padding: 1px 5px; font-size: 0.65rem; }
}
/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: zoom-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 10px;
}
.lightbox-overlay.show {
    display: flex;
    animation: lightboxIn 0.25s ease;
}
@keyframes lightboxIn {
    from { opacity: 0; } to { opacity: 1; }
}
.lightbox-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    cursor: default;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 12px;
    left: 12px;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 100001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
/* Dropzone custom */
.policy-dropzone.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    background: var(--body-bg);
    min-height: 120px;
    padding: 15px;
    transition: var(--transition);
}
.policy-dropzone.dropzone:hover,
.policy-dropzone.dropzone.dz-drag-hover {
    border-color: var(--primary);
    background: rgba(218,165,32,0.05);
}
.policy-dropzone .dz-message {
    margin: 10px 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.policy-dropzone .dz-preview {
    min-height: 80px;
}
/* Blance file source badges */
.file-source-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    z-index: 2;
}

/* ======= PIPELINE CARDS ======= */
.pipeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.pipeline-column {
    background: var(--body-bg);
    border-radius: var(--radius);
    padding: 15px;
}

.pipeline-column .column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.pipeline-column .column-header h6 {
    font-weight: 700;
    margin: 0;
    font-size: 0.95rem;
}

.pipeline-column .column-header .count {
    background: var(--primary);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.pipeline-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-right: 3px solid var(--primary);
    transition: var(--transition);
}

.pipeline-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.pipeline-card .card-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.pipeline-card .card-company {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.pipeline-card .card-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.pipeline-card .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.pipeline-card .card-actions .btn {
    flex: 1;
    padding: 5px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ======= MODAL STYLES ======= */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 18px 22px;
}

.modal-header .modal-title {
    font-weight: 700;
}

.modal-body { padding: 22px; }

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 22px;
}

/* ======= ALERTS ======= */
.alert-custom {
    border-radius: var(--radius-sm);
    border: none;
    padding: 14px 20px;
    font-weight: 500;
}

/* ======= NOTIFICATION DROPDOWN ======= */
.notification-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    width: 350px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1001;
    display: none;
}

.notification-dropdown.show { display: block; }

.notification-dropdown .n-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-dropdown .n-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notification-dropdown .n-item:hover {
    background: var(--body-bg);
}

.notification-dropdown .n-item.unread {
    background: rgba(218,165,32,0.05);
    border-right: 3px solid var(--primary);
}

/* ======= RESPONSIVE ======= */
.sidebar-toggle {
    display: none;
    background: var(--primary-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .top-navbar {
        right: 0;
    }
    
    .navbar-search {
        width: 200px;
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .welcome-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pipeline-container {
        grid-template-columns: 1fr;
    }
}

/* ======= TABLET RESPONSIVE (577px - 992px) ======= */
@media (min-width: 577px) and (max-width: 992px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 10px 12px;
    }

    .content-card {
        padding: 18px;
    }

    .modal-dialog {
        max-width: 90%;
    }

    .notification-dropdown {
        width: 300px;
    }

    /* Better form layout for tablets */
    .row > .col-md-6,
    .row > .col-md-4,
    .row > .col-md-3 {
        padding-left: 8px;
        padding-right: 8px;
    }

    .welcome-banner {
        padding: 20px;
    }

    .btn-group .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Horizontal scroll for wide tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .navbar-search {
        display: none;
    }
    
    .top-navbar {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .login-card {
        margin: 15px;
        padding: 30px 25px;
    }
    
    .data-table {
        font-size: 0.82rem;
    }
    
    .data-table thead th,
    .data-table tbody td {
        padding: 8px 10px;
    }
}

/* ======= LOADING ======= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-gold {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ======= PRINT ======= */
@media print {
    .sidebar, .top-navbar, .sidebar-toggle, .no-print, .btn, .btn-group, .pagination-custom, .nav-tabs, form, .modal, .sidebar-overlay {
        display: none !important;
    }
    /* Hide action columns */
    .no-print-col { display: none !important; }
    /* Hide stat cards, summary boxes, and filter sections in print */
    .stat-card, .stat-value, .stat-label { display: none !important; }
    .row.g-2.mb-3, .row.g-3.mb-4, .row.mb-4:not(:has(table)) { display: none !important; }
    .d-flex.justify-content-between.align-items-center.mb-4 { display: none !important; }
    .progress { display: none !important; }
    /* Show print-only header with logo */
    .print-only-header { display: block !important; }
    /* Show print-only stamp & footer */
    .print-only-stamp { display: block !important; }
    .main-content {
        margin: 0 !important;
        padding: 10px !important;
    }
    body {
        background: #fff !important;
        font-size: 12px;
    }
    @page {
        margin: 10mm;
        size: auto;
    }
    /* Table handling for multi-page */
    table thead { display: table-header-group; }
    table tfoot { display: table-footer-group; }
    table tr { page-break-inside: avoid; }
    table { page-break-inside: auto; margin-left: auto; margin-right: auto; }
    /* Center table content */
    .table-responsive { overflow: visible !important; display: flex; justify-content: center; }
    /* Clear table borders */
    .data-table th, .data-table td, table th, table td { border: 1px solid #333 !important; padding: 6px 8px; }
    .data-table th, table th { background: #f0f0f0 !important; font-weight: 700; white-space: nowrap; }
    .data-table td, table td { word-wrap: break-word; }
    /* Card and content sections */
    .content-card, .card { page-break-inside: avoid; border: 1px solid #ccc !important; }
    .content-card:has(.table-responsive), .content-card:has(table) { page-break-inside: auto; }
    .card-header { page-break-after: avoid; }
    /* Table totals row */
    .table-warning td { background: rgba(218,165,32,0.15) !important; }
    .table-info td { background: #d1ecf1 !important; }
    /* Ensure colors print */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* Print-only elements (hidden on screen) */
.print-only-header { display: none; }
.print-only-stamp { display: none; }

/* ======= PAGINATION ======= */
.pagination-custom .page-link {
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 8px 14px;
    font-weight: 500;
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
}

.pagination-custom .page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-custom .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ======= ANIMATION ======= */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======= EMPTY STATE ======= */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 15px;
}

.empty-state h5 {
    color: var(--text-muted);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ======================================
   Dropzone Custom Styling
   ====================================== */
.dropzone {
    border: 2px dashed var(--primary) !important;
    border-radius: 12px !important;
    background: #fffdf5 !important;
    min-height: 150px !important;
    padding: 20px !important;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif !important;
}

.dropzone:hover {
    border-color: var(--primary-dark) !important;
    background: #fff8e1 !important;
}

.dropzone .dz-message {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin: 1.5em 0;
}

.dropzone .dz-message .dz-button {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    color: var(--primary-dark);
    background: none;
    border: none;
}

.dropzone .dz-preview .dz-remove {
    font-size: 0.85rem;
    color: #dc3545;
    margin-top: 5px;
}

.dropzone .dz-preview .dz-details {
    font-family: 'Tajawal', sans-serif;
}

.dropzone .dz-preview .dz-success-mark svg,
.dropzone .dz-preview .dz-error-mark svg {
    width: 40px;
    height: 40px;
}

