/* 
 * Yaqeen Workspace Management System Design stylesheet
 * Custom Premium aesthetics with Cairo and Inter Google Fonts
 */

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

:root {
    --primary: #0F1A16; /* Yaqeen Primary Dark Green */
    --primary-hover: #2E3A31; /* Yaqeen Secondary Green */
    --accent-gold: #DCC9A3; /* Gold/Beige Accent */
    --brown-gold: #A68A5B; /* Warm Brown Gold */
    --bg-cream: #F6F3EE; /* Warm Off-white */
    
    --primary-gradient: linear-gradient(135deg, #0F1A16 0%, #2E3A31 100%);
    --secondary-gradient: linear-gradient(135deg, #A68A5B 0%, #DCC9A3 100%);
    --success-gradient: linear-gradient(135deg, #2E3A31 0%, #46574a 100%);
    --info-gradient: linear-gradient(135deg, #A68A5B 0%, #826a41 100%);
    --warning-gradient: linear-gradient(135deg, #DCC9A3 0%, #baaa88 100%);
    --danger-gradient: linear-gradient(135deg, #c93b3b 0%, #9e2323 100%);
    --dark-gradient: linear-gradient(135deg, #151d1a 0%, #0F1A16 100%);
    
    --bg-light: #F6F3EE; /* Beautiful cream background */
    --card-shadow: 0 8px 30px rgba(15, 26, 22, 0.04);
    --transition-speed: 0.3s;
}

/* Light / Dark Mode Tokens */
body.dark-mode {
    --bg-light: #121212;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.5);
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .card {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #2d2d2d !important;
}
body.dark-mode .table {
    color: #e0e0e0 !important;
}
body.dark-mode .table th, body.dark-mode .table td {
    border-color: #2d2d2d !important;
}
body.dark-mode .sidebar {
    background: #181818 !important;
    border-color: #2d2d2d !important;
}
body.dark-mode .navbar {
    background: #1e1e1e !important;
    border-color: #2d2d2d !important;
}
body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #2d2d2d !important;
}
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #3d3d3d !important;
}

/* Fonts and Typographic Hierarchy */
body {
    background-color: var(--bg-light);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}
body[dir="ltr"] {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Glassmorphic Sidebar Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar.sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--primary);
    color: rgba(246, 243, 238, 0.85);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-height: 100vh;
    border-inline-end: 1px solid rgba(220, 201, 163, 0.08);
}

body.dark-mode #sidebar.sidebar {
    background: #090e0c !important;
    border-inline-end: 1px solid rgba(220, 201, 163, 0.05) !important;
}

#sidebar.sidebar.active {
    margin-inline-start: -260px;
}

.sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(180deg, #090e0c 0%, var(--primary) 100%);
    border-bottom: 1px solid rgba(220, 201, 163, 0.08);
    text-align: center;
}

.sidebar-header img {
    max-width: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.sidebar-header .badge {
    background-color: rgba(220, 201, 163, 0.15) !important;
    color: var(--accent-gold) !important;
    font-weight: 600;
    padding: 6px 12px;
}

.sidebar ul.components {
    padding: 25px 12px;
}

.sidebar ul li {
    margin-bottom: 6px;
}

.sidebar ul li a {
    padding: 12px 18px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(246, 243, 238, 0.75);
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-weight: 500;
}

body.dark-mode .sidebar ul li a {
    color: rgba(246, 243, 238, 0.75) !important;
}

.sidebar ul li a i {
    font-size: 1.25rem;
    color: var(--accent-gold);
    opacity: 0.85;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar ul li a:hover {
    color: #ffffff;
    background: rgba(220, 201, 163, 0.08);
}

.sidebar ul li a:hover i {
    transform: scale(1.15);
    opacity: 1;
}

/* Active Menu Item Styling */
.sidebar ul li.active > a {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(166, 138, 91, 0.25) 0%, rgba(220, 201, 163, 0.15) 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(220, 201, 163, 0.15) !important;
    position: relative;
    font-weight: 600;
}

/* Gold active indicator stripes (bidirectional RTL/LTR support) */
body[dir="ltr"] .sidebar ul li.active > a {
    border-left: 4px solid var(--accent-gold);
}
body[dir="rtl"] .sidebar ul li.active > a {
    border-right: 4px solid var(--accent-gold);
}

.sidebar ul li.active > a i {
    color: var(--accent-gold) !important;
    opacity: 1;
}

/* Content Container */
#content {
    width: 100%;
    padding: 25px;
    min-height: 100vh;
    transition: all var(--transition-speed);
}

/* Premium Dashboard Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), box-shadow var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card-counter {
    position: relative;
    padding: 25px;
    color: #fff;
}

.card-counter .icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 3.5rem;
    opacity: 0.15;
    transition: transform 0.3s;
}

body[dir="rtl"] .card-counter .icon {
    right: auto;
    left: 20px;
}

.card-counter:hover .icon {
    transform: scale(1.15) rotate(-5deg);
}

/* Card Gradient Color Sets */
.bg-gradient-primary { background: var(--primary-gradient); }
.bg-gradient-success { background: var(--success-gradient); }
.bg-gradient-info { background: var(--info-gradient); }
.bg-gradient-warning { background: var(--warning-gradient); }
.bg-gradient-danger { background: var(--danger-gradient); }
.bg-gradient-dark { background: var(--dark-gradient); }

/* Custom Badge Toggles */
.badge-status {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Elegant Table Styling */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    background-color: #f1f3f9;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 15px;
}

body.dark-mode .table th {
    background-color: #252525;
}

.table td {
    padding: 15px;
}

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: #f8f9fc;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

body.dark-mode .modal-header {
    background: #252525;
    border-bottom-color: #2d2d2d;
}

/* Printable Invoices (Thermal & standard layout) */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .no-print {
        display: none !important;
    }
    #content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
    }
}

/* Thermal Printer Specifics (58mm/80mm size specs) */
.thermal-receipt {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    background: #fff;
    color: #000;
    font-family: 'Cairo', 'Inter', monospace;
    font-size: 11px;
}

.thermal-receipt .header {
    text-align: center;
    margin-bottom: 15px;
}

.thermal-receipt .header img {
    max-width: 50px;
}

.thermal-receipt hr {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.thermal-receipt table {
    width: 100%;
    font-size: 10px;
}

.thermal-receipt .total-box {
    text-align: right;
    font-weight: bold;
    font-size: 12px;
}

body[dir="rtl"] .thermal-receipt .total-box {
    text-align: left;
}

/* Real-time pulses for running timers */
.pulse-badge {
    position: relative;
}
.pulse-badge::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #1cc88a;
    border-radius: 50%;
    margin-inline-start: 6px;
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* Nice scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* --- BRAND ALIGNMENT & PREMIUM STYLING OVERRIDES --- */

/* Override Bootstrap Primary Buttons */
.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 10px rgba(15, 26, 22, 0.15) !important;
    transition: all 0.25s ease !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(15, 26, 22, 0.25) !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background: transparent !important;
    transition: all 0.25s ease !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Primary Text & Border Utilities mapping to Yaqeen brand */
.text-primary {
    color: var(--primary) !important;
}
.border-primary {
    border-color: var(--primary) !important;
}
.bg-primary {
    background-color: var(--primary) !important;
}

/* Custom styles for Top Navbar */
.navbar {
    background: #ffffff !important;
    border: 1px solid rgba(15, 26, 22, 0.06) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

body.dark-mode .navbar {
    background: #181818 !important;
    border-color: rgba(220, 201, 163, 0.1) !important;
}

/* Redesign Dashboard stats cards borders */
.border-start.border-4.border-primary {
    border-color: var(--primary) !important;
}
.border-start.border-4.border-info {
    border-color: var(--brown-gold) !important;
}
.border-start.border-4.border-success {
    border-color: var(--primary-hover) !important;
}
.text-info {
    color: var(--brown-gold) !important;
}

/* Smooth toggle switches themed in gold/green */
.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
body.dark-mode .form-check-input:checked {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
}

/* Soft gold transitions for active state */
.dropdown-item:active, .dropdown-item:hover {
    background-color: rgba(220, 201, 163, 0.15) !important;
    color: var(--primary) !important;
}
body.dark-mode .dropdown-item:active, body.dark-mode .dropdown-item:hover {
    color: #fff !important;
    background-color: rgba(220, 201, 163, 0.2) !important;
}
