/* ==========================================================================
   CARNIVAL TRADING SYSTEM - MAIN STYLESHEET
   Clean Architecture CSS Organization
   ========================================================================== */

/* ==========================================================================
   1. FOUNDATIONS - Base styles and resets
   ========================================================================== */

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

/* CSS Variables */
:root {
    --primary-color: rgba(13, 44, 112, 0.95);
    --secondary-color: #cc262d;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    background: #f5f5f5;
    font-family: "Cairo", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

body.home-page {
    background: #f8f9fa;
}

body.home-page .main-content {
    padding: 0;
    margin: 0;
}

body.home-page .container {
    max-width: none;
    padding: 0;
}

/* ==========================================================================
   2. LAYOUT - Structural components
   ========================================================================== */

.main-content {
    min-height: calc(100vh - 80px);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}

.main-content .container {
    max-width: none;
    padding: 0;
}

/* Modern Layout */
.modern-container {
    width: 100%;
    padding: 20px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ==========================================================================
   3. NAVIGATION - Top bar and navigation components
   ========================================================================== */

.top-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    position: relative;
    flex-direction: row-reverse;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
}

.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-section {
    position: relative;
}

.nav-section-title {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
}

.nav-section-title:hover {
    background: rgba(255,255,255,0.2);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 10px 0;
    display: none;
    z-index: 1000;
    border: 1px solid #e0e0e0;
}

.nav-dropdown .nav-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-dropdown .nav-item:hover {
    background: #f8f9fa;
    color: #87CEEB;
}

.nav-dropdown .nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

/* ==========================================================================
   4. COMPONENTS - Reusable UI components
   ========================================================================== */

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-container a {
    display: block;
    transition: all 0.3s ease;
}

.logo-container a:hover {
    transform: scale(1.05);
}

.logo {
    height: 60px;
    width: auto;
    cursor: pointer;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    color: #000;
    font-size: 14px;
}

.user-avatar {
    position: relative;
    width: 24px;
    height: 24px;
}

.avatar-circle {
    position: absolute;
    left: 13.78%;
    right: 13.78%;
    top: 58.33%;
    bottom: 12.5%;
    background: #222222;
    border-radius: 50%;
}

.avatar-head {
    position: absolute;
    left: 29.17%;
    right: 29.17%;
    top: 12.5%;
    bottom: 45.83%;
    background: #222222;
    border-radius: 50%;
}

.user-id-label {
    font-weight: 600;
    color: #000;
}

.user-id {
    font-weight: 400;
    color: #000;
}

/* Language Selector */
.language-selector select {
    background: rgba(0,0,0,0.1);
    color: #000;
    border: 1px solid rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: "Cairo", sans-serif;
    cursor: pointer;
}

/* Logout */
.logout-btn {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.3);
    color: #000;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* ==========================================================================
   5. FORMS - Form components and inputs
   ========================================================================== */

.form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: 0 20px 20px 20px;
    overflow: visible;
    transition: all 0.3s ease;
}

.form-container:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
}

.form-body {
    padding: 30px;
    overflow: visible;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-control,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #87CEEB;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
    transform: translateY(-1px);
}

/* Modern Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.modern-input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.modern-input:focus {
    outline: none;
    border-color: #87CEEB;
    background: white;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

/* ==========================================================================
   6. BUTTONS - Button styles and variations
   ========================================================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #0070f3;
    color: white;
    border-color: #0070f3;
}

.btn-primary:hover {
    background: #005bb5;
    border-color: #005bb5;
}

.btn-secondary {
    background: white;
    color: #0070f3;
    border-color: #0070f3;
}

.btn-secondary:hover {
    background: #f0f8ff;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    justify-content: flex-end;
}

/* Dropdown List Styles */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* Form Header Button Alignment */
.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header .btn {
    margin-left: auto;
}

/* Modern Button Styles */
.modern-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-clear {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================================================
   7. HOME PAGE STYLES - Hero section and quick access
   ========================================================================== */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 80px 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-user-info {
    position: absolute;
    top: 20px;
    right: 40px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    max-width: fit-content;
}

.hero-user-info .user-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.hero-user-info .user-name {
    font-weight: 600;
    font-size: 15px;
    color: white;
    white-space: nowrap;
}

.hero-user-info .logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.hero-user-info .logout-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
}

/* Hero Content Animation */
.hero-text h1 {
    font-size: 38px;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(100px);
    animation: slideInFromRight 1s ease-out 0.5s forwards;
}

.hero-text h2 {
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(100px);
    animation: slideInFromRight 1s ease-out 0.8s forwards;
}

.hero-image {
    text-align: center;
    opacity: 0;
    transform: translateX(100px);
    animation: slideInFromRight 1s ease-out 0.2s forwards;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    max-height: 300px;
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Quick Access Section */
.quick-access-section {
    padding: 120px 0 80px 0;
    background: #f8f9fa;
    overflow: visible;
}

.module-section {
    margin-bottom: 50px;
}

.module-title {
    font-size: 24px;
    color: #0d2c70;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid #87CEEB;
    font-weight: 600;
    text-align: right;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.access-card {
    background: white;
    padding: 50px 30px 30px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    cursor: pointer;
    position: relative;
    overflow: visible;
    margin-top: 50px;
}

.access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e0e0e0;
    text-decoration: none;
    color: inherit;
}

.access-icon-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.access-card h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
    margin-top: 10px;
}

.access-card p {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.access-card::after {
    content: '→';
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 14px;
    color: #87CEEB;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.access-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Truck Animation */
.truck-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.truck {
    position: absolute;
    right: -200px;
    top: 50%;
    transform: translateY(-50%);
    animation: truckDrive 4s ease-in-out forwards;
}

.truck-body {
    font-size: 60px;
    display: inline-block;
    animation: truckBounce 0.5s ease-in-out infinite alternate;
}

.truck-cargo {
    position: absolute;
    top: -20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    animation: cargoFloat 1s ease-in-out infinite alternate;
}

.cargo-logo {
    font-size: 20px;
}

.cargo-text {
    font-size: 14px;
}

@keyframes truckDrive {
    0% {
        right: -200px;
        left: auto;
    }
    100% {
        right: 100%;
        left: auto;
        opacity: 0;
    }
}

@keyframes truckBounce {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-5px);
    }
}

@keyframes cargoFloat {
    0% {
        transform: translateY(0px) rotate(-2deg);
    }
    100% {
        transform: translateY(-3px) rotate(2deg);
    }
}

/* Hero Content Animation */
.hero-title {
    opacity: 0;
    transform: translateY(30px);
    animation: heroTitleAppear 1s ease-out 2.5s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: heroSubtitleAppear 1s ease-out 3s forwards;
}

.hero-logo {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
    animation: heroLogoAppear 1s ease-out 3.5s forwards;
}

@keyframes heroTitleAppear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSubtitleAppear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroLogoAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ==========================================================================
   7. TABLES - Table styles and data display
   ========================================================================== */

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0 20px 20px 20px;
}

.table-container:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.table-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

.table td {
    padding: 12px 15px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    text-align: center;
}

.table th:last-child,
.table td:last-child {
    border-right: none;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
    transform: scale(1.01);
}

/* Modern Data Tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
}

/* Bulk Add Table Styles - Make tables fit without horizontal scroll */
.data-table table {
    table-layout: fixed;
    width: 100%;
}

.data-table th:nth-child(1), /* Product */
.data-table td:nth-child(1) {
    width: 40%;
}

.data-table th:nth-child(2), /* Sale Price / Unit Cost */
.data-table td:nth-child(2),
.data-table th:nth-child(3), /* Customer Price */
.data-table td:nth-child(3) {
    width: 20%;
}

.data-table th:nth-child(4), /* Actions */
.data-table td:nth-child(4) {
    width: 20%;
}

/* Make inputs more compact in data tables */
.data-table .modern-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
}

.data-table .modern-btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ==========================================================================
   8. CARDS - Card components and modern layouts
   ========================================================================== */

.modern-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* ==========================================================================
   9. TABS - Tab navigation and content
   ========================================================================== */

.tab-container {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modern Tabs */
.modern-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.modern-tab-btn {
    padding: 15px 30px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.modern-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.modern-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ==========================================================================
   10. PAGE HEADERS - Page titles and headers
   ========================================================================== */

.page-header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* Modern Page Title */
.page-title {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.page-title h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-title p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* ==========================================================================
   11. STATUS & BADGES - Status indicators and badges
   ========================================================================== */

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #e8f5e8;
    color: #256f3a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff4e6;
    color: #b44f00;
}

/* ==========================================================================
   12. UTILITIES - Loading, animations, and utility classes
   ========================================================================== */

/* Loading Screen Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #87CEEB;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Modal Styles */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.3s ease;
}

.notification-modal.show {
    display: flex;
}

.notification-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

.notification-content.success {
    border-top: 4px solid #28a745;
}

.notification-content.error {
    border-top: 4px solid #dc3545;
}

.notification-content.warning {
    border-top: 4px solid #ffc107;
}

.notification-content.info {
    border-top: 4px solid #17a2b8;
}

.notification-header {
    padding: 20px 20px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 24px;
}

.notification-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.notification-body {
    padding: 0 20px 20px;
}

.notification-message {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.notification-footer {
    padding: 0 20px 20px;
    text-align: right;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Edit Button */
.edit-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==========================================================================
   13. RTL SUPPORT - Right-to-left language support
   ========================================================================== */

[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .top-bar {
    direction: rtl;
}

[dir="rtl"] .top-bar-left {
    order: 2;
}

[dir="rtl"] .top-bar-right {
    order: 1;
}

[dir="rtl"] .form-row {
    direction: rtl;
}

[dir="rtl"] .table {
    direction: rtl;
}

[dir="rtl"] .nav-dropdown {
    right: 0;
    left: auto;
}

[dir="rtl"] .main-nav {
    direction: ltr;
}

/* ==========================================================================
   14. HOME PAGE STYLES - Specific styles for the home page
   ========================================================================== */

/* Hero Section - Consolidated definition */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 80px 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    text-align: right;
    direction: rtl;
}

.hero-text h1 {
    font-size: 48px;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.hero-text h2 {
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-title {
    font-size: 48px;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: heroTitleAppear 1s ease-out 2.5s forwards;
}

.hero-subtitle {
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(30px);
    animation: heroSubtitleAppear 1s ease-out 3s forwards;
}

.hero-image {
    text-align: center;
}

/* Quick Access Section */
.quick-access-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.module-section {
    margin-bottom: 50px;
}

.module-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 40px;
    position: relative;
}

.module-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.access-card {
    background: white;
    padding: 50px 30px 30px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    cursor: pointer;
    position: relative;
    overflow: visible;
    margin-top: 50px;
}

.access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e0e0e0;
    text-decoration: none;
    color: inherit;
}

.access-icon-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e3a8a 0%, #87CEEB 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.access-card h4 {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 15px;
}

.access-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   15. RESPONSIVE DESIGN - Media queries for different screen sizes
   ========================================================================== */

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .modern-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .hero-text h1 {
        font-size: 36px;
    }
    
    .hero-text h2 {
        font-size: 28px;
    }
    
    .quick-access-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .module-title {
        font-size: 20px;
        text-align: center;
    }
    
    .hero-section {
        padding: 60px 20px;
    }
}


/* ==========================================================================
   16. IMPROVED USER INFO SECTION - Better styling for name and logout
   ========================================================================== */

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
    letter-spacing: 0.3px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logout-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.logout-btn svg {
    display: block;
}


/* ==========================================================================
   17. DASHBOARD STYLES - Dashboard-specific components
   ========================================================================== */

/* Dashboard Tabs */
.db-tabs {
    display: flex;
    gap: 8px;
    padding: 0 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.db-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
}

.db-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.db-tab.active {
    background: #fff;
    color: #1e3a8a;
}

/* Dashboard Header */
.db-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 32px 28px 48px;
    position: relative;
    overflow: hidden;
}

.db-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.db-header::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.db-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    gap: 20px;
}

.db-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.db-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.date-range-picker label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.date-range-picker input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #1e3a8a;
    font-weight: 600;
    cursor: pointer;
}

.date-range-picker input:focus {
    outline: 2px solid #fff;
}

/* Live Badge */
.db-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.db-live-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: .5;
        transform: scale(1.4);
    }
}

/* KPI Cards */
.kpi-wrapper {
    padding: 0 24px;
    margin-top: -36px;
    position: relative;
    z-index: 2;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.kpi-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.kpi-card.visible {
    animation: cardIn 0.5s ease forwards;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.kpi-card.blue::before {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.kpi-card.green::before {
    background: linear-gradient(90deg, #059669, #34d399);
}

.kpi-card.violet::before {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.kpi-card.orange::before {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.kpi-card.red::before {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-card.blue .kpi-icon {
    background: #eff6ff;
}

.kpi-card.green .kpi-icon {
    background: #ecfdf5;
}

.kpi-card.violet .kpi-icon {
    background: #f5f3ff;
}

.kpi-card.orange .kpi-icon {
    background: #fffbeb;
}

.kpi-card.red .kpi-icon {
    background: #fef2f2;
}

.kpi-trend {
    display: none;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.kpi-trend.up {
    background: #ecfdf5;
    color: #059669;
}

.kpi-trend.down {
    background: #fef2f2;
    color: #dc2626;
}

.kpi-value {
    font-size: 30px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.kpi-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    margin-top: 14px;
}

.spark-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    opacity: 0.5;
    transition: opacity 0.2s;
    min-width: 0;
}

.kpi-card:hover .spark-bar {
    opacity: 0.85;
}

.kpi-card.blue .spark-bar {
    background: #3b82f6;
}

.kpi-card.green .spark-bar {
    background: #10b981;
}

.kpi-card.violet .spark-bar {
    background: #8b5cf6;
}

.kpi-card.orange .spark-bar {
    background: #f59e0b;
}

.kpi-card.red .spark-bar {
    background: #ef4444;
}

/* Dashboard Body */
.db-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    padding: 24px 24px 0;
}

@media (max-width: 900px) {
    .db-body {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Panels */
.db-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.db-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.db-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.db-panel-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.db-view-all {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.db-view-all:hover {
    text-decoration: underline;
}

/* Deliveries Table */
.deliveries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.deliveries-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
    background: #f8fafc;
}

.deliveries-table td {
    padding: 13px 16px;
    border-top: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.del-row {
    opacity: 0;
    transform: translateX(-20px);
    transition: background 0.2s;
}

.del-row.visible {
    animation: rowIn 0.4s ease forwards;
}

.del-row:hover td {
    background: #f8fafc;
}

@keyframes rowIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.del-id {
    font-weight: 700;
    color: #1e40af;
    font-size: 12px;
}

.del-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-delivered {
    background: #ecfdf5;
    color: #059669;
}

.badge-transit {
    background: #eff6ff;
    color: #2563eb;
}

.badge-processing {
    background: #fffbeb;
    color: #d97706;
}

.badge-return {
    background: #fef2f2;
    color: #dc2626;
}

/* Sidebar */
.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-summary-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    padding: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-summary-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 110px;
    height: 110px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.stat-summary-title {
    font-size: 13px;
    font-weight: 600;
    opacity: .8;
    margin-bottom: 6px;
}

.stat-summary-value {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
}

.stat-summary-sub {
    font-size: 12px;
    opacity: .7;
    margin-top: 4px;
}

.stat-bar-wrap {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.stat-bar-label {
    width: 80px;
    flex-shrink: 0;
}

.stat-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: #fff;
    width: 0;
    transition: width 1.2s ease;
}

.stat-bar-pct {
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

/* Quick Links */
.quick-links-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s, color 0.2s;
}

.quick-link-item:last-child {
    border-bottom: none;
}

.quick-link-item:hover {
    background: #eff6ff;
    color: #2563eb;
}

.quick-link-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.quick-link-arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: 16px;
}

/* Dashboard Bottom Metrics */
.db-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    padding: 20px 24px 28px;
}

.metric-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(20px);
}

.metric-card.visible {
    animation: cardIn 0.5s ease forwards;
}

.metric-emoji {
    font-size: 32px;
}

.metric-info strong {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    display: block;
}

.metric-info span {
    font-size: 12px;
    color: #64748b;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.login-logo {
    text-align: center;
    margin-bottom: 30px;
}
.login-logo img {
    max-width: 150px;
    height: auto;
}
.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}
.login-form .form-group {
    margin-bottom: 20px;
}
.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}
.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.login-form input:focus {
    outline: none;
    border-color: #667eea;
}
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}
.login-btn:hover {
    transform: translateY(-2px);
}
.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
    text-align: center;
}


/* ==========================================================================
   NOTIFICATION MODAL & LOADING OVERLAY
   ========================================================================== */

/* Notification Modal */
.notification-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.notification-modal.show {
  opacity: 1;
  pointer-events: all;
}

.notification-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.notification-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

.notification-icon {
  text-align: center;
  font-size: 64px;
  padding: 30px 20px 10px;
  animation: iconBounce 0.5s ease-out;
}

.notification-header {
  text-align: center;
  padding: 0 20px 20px;
}

.notification-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.notification-body {
  padding: 0 30px 30px;
  text-align: center;
}

.notification-body p {
  margin: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1.6;
}

.notification-footer {
  padding: 20px 30px 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.notification-footer .btn {
  min-width: 120px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes modalSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.loading-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  margin: 0 auto 20px;
}

.loading-spinner .spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid #87CEEB;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-top: 15px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}


/* Login Page Body Background */
body.login-page {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 100vh;
}

body.login-page .main-content {
  background: transparent;
}

/* ── Schedule Table ── */
.schedule-table-wrapper {
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.schedule-table thead tr {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.schedule-table thead th {
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.schedule-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
}

.schedule-table tbody tr:last-child {
  border-bottom: none;
}

.schedule-table tbody td {
  padding: 10px 16px;
  text-align: center;
  vertical-align: middle;
  color: #888;
}

.schedule-row-active td {
  color: #333 !important;
  background: #f8fff8;
}

.schedule-day-name {
  font-weight: 600;
  font-size: 14px;
  min-width: 80px;
}

.schedule-time {
  width: 130px !important;
  padding: 8px 10px !important;
  text-align: center;
  background: #f8f9fa;
}

.schedule-time:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f0f0f0;
}

.schedule-time:not(:disabled) {
  background: white;
}

.schedule-hours {
  font-weight: 700;
  min-width: 80px;
  font-size: 13px;
}

.schedule-toggle {
  width: 60px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Contract Create: fieldset sections (legacy) ── */
.form-section {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section legend {
  font-weight: 600;
  font-size: 1rem;
  padding: 0 0.5rem;
  color: var(--primary-color, #1976d2);
}

.form-hint {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1rem;
}

/* ── Schedule day rows ── */
.day-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
  flex-wrap: wrap;
}

.day-row:last-child { border-bottom: none; }

.day-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 110px;
  font-weight: 500;
  cursor: pointer;
}

.day-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.day-times {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group.inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
}

.form-group.inline label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 0.9rem;
}

.form-group.inline input[type="time"] {
  width: 130px;
}

/* ── Generic Status Badges ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e5e7eb; color: #374151; }
.badge-info      { background: #dbeafe; color: #1e40af; }

/* ── Notification Bell Dropdown ────────────────────────────── */
.notif-drop-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
  direction: rtl;
}
.notif-drop-item:last-child {
  border-bottom: none;
}
.notif-drop-item:hover {
  background: #fafafa;
}
.notif-drop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.notif-drop-type {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #667eea;
}
.notif-drop-date {
  font-size: 11px;
  color: #a0aec0;
}
.notif-drop-title {
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 2px;
  line-height: 1.4;
}
.notif-drop-sub {
  font-size: 12px;
  color: #718096;
  margin-bottom: 8px;
}
.notif-drop-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.notif-btn-approve,
.notif-btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.notif-btn-approve:hover,
.notif-btn-reject:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.notif-btn-approve:disabled,
.notif-btn-reject:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.notif-btn-approve {
  background: #48bb78;
  color: #fff;
}
.notif-btn-reject {
  background: #fc8181;
  color: #fff;
}
