/* Sokoun Invoice System - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --accent: #0284c7;
    --bg-light: #f8fafc;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: #1e293b;
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
}

/* Remove default number input spinners */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Active Styles */
.nav-tab.active {
    background-color: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2), 0 2px 4px -2px rgba(30, 58, 138, 0.2);
}

.nav-tab:not(.active) {
    color: #475569;
}
.nav-tab:not(.active):hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 280px;
}

.toast-success {
    background-color: #10b981;
    color: #ffffff;
}

.toast-error {
    background-color: #ef4444;
    color: #ffffff;
}

.toast-info {
    background-color: #0284c7;
    color: #ffffff;
}

/* ======================================================== */
/* Rock-Solid Modal System (No Viewport Cutoffs Guaranteed) */
/* ======================================================== */
.app-modal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.app-modal.hidden {
    display: none !important;
}

.app-modal-dialog {
    background: #ffffff !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
    width: 100% !important;
    max-width: 950px !important;
    height: 88vh !important;
    max-height: 820px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid #cbd5e1 !important;
    margin: auto !important;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.app-modal-dialog-sm {
    max-width: 480px !important;
    height: auto !important;
    max-height: 90vh !important;
}

.app-modal-dialog-sm .app-modal-body {
    overflow-y: auto !important;
    max-height: calc(90vh - 110px) !important;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.app-modal-header {
    padding: 16px 22px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
}

.app-modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 16px 22px !important;
    min-height: 0 !important;
}

.app-modal-footer {
    padding: 14px 22px !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f8fafc !important;
    flex-shrink: 0 !important;
}

/* ======================================================== */
/* Quick Product Picker Cards & Steppers */
/* ======================================================== */
.qp-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 12px !important;
}

.qp-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.qp-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.qp-card.active {
    background: #f0fdf4 !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

.qp-stepper-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 3px;
    border: 1px solid #e2e8f0;
}

.qp-step-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-weight: 900;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    border: none;
}

.qp-step-minus {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.qp-step-minus:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.qp-step-plus {
    background: #1e3a8a;
    color: #ffffff;
}
.qp-step-plus:hover {
    background: #1e40af;
}

.qp-step-plus10 {
    background: #047857;
    color: #ffffff;
    font-size: 11px;
    padding: 0 7px;
    height: 30px;
    border-radius: 7px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qp-step-plus10:hover {
    background: #065f46;
}

.qp-step-input {
    width: 44px;
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    background: transparent;
    border: none;
    color: #0f172a;
    outline: none;
}

/* Colors and utility enhancements */
.bg-blue-950 { background-color: #0f172a !important; }
.border-blue-900 { border-color: #1e3a8a !important; }
.text-blue-950 { color: #0f172a !important; }
.bg-emerald-700 { background-color: #047857 !important; }
.hover\:bg-emerald-800:hover { background-color: #065f46 !important; }
.text-emerald-700 { color: #047857 !important; }
.bg-emerald-50 { background-color: #ecfdf5 !important; }
.border-emerald-200 { border-color: #a7f3d0 !important; }
.border-emerald-300 { border-color: #6ee7b7 !important; }
.bg-emerald-100 { background-color: #d1fae5 !important; }
.text-emerald-800 { color: #065f46 !important; }

/* Auth & Modal Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.animate-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-fade-in {
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

