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

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background-color: #F8F5F1;
}

/* Sidebar Transition */
#sidebar {
    width: 80px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
#sidebar.expanded {
    width: 240px;
}

/* Toggle Button */
#sidebar-toggle {
    cursor: pointer;
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toggle-arrow, .toggle-logo, .toggle-logo-mini {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-arrow {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.toggle-logo {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}
.toggle-logo-mini {
    opacity: 0;
    transform: scale(0.5);
    display: block !important;
}
#sidebar.expanded .toggle-arrow {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}
#sidebar.expanded .toggle-logo {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
#sidebar.expanded .toggle-logo-mini {
    opacity: 0;
    transform: scale(0.5);
}
#sidebar:not(.expanded) .toggle-logo-mini {
    opacity: 1;
    transform: scale(1);
}
#sidebar:not(.expanded) .toggle-arrow {
    opacity: 0;
    transform: scale(0.5);
}

/* Sidebar Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #C8B8A6;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link:hover {
    background-color: rgba(233, 220, 203, 0.15);
    color: #E9DCCB;
}
.sidebar-link.active {
    background-color: rgba(233, 220, 203, 0.15);
    color: #E9DCCB;
}
.sidebar-link .link-icon {
    min-width: 20px;
    text-align: center;
    font-size: 16px;
}
.sidebar-link .link-text {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
}
#sidebar.expanded .sidebar-link .link-text {
    opacity: 1;
    transform: translateX(0);
}

/* Sidebar - Light version for Company */
#sidebar.light {
    background: #FFFFFF !important;
    border-left: 1px solid #E6DDD2 !important;
}
#sidebar.light .sidebar-link {
    color: #8A7D74;
}
#sidebar.light .sidebar-link:hover {
    background-color: rgba(107, 93, 82, 0.08);
    color: #6B5D52;
}
#sidebar.light .sidebar-link.active {
    background-color: rgba(107, 93, 82, 0.08);
    color: #6B5D52;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #E9DCCB;
    box-shadow: 0 1px 2px rgba(78,67,59,0.04);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(78,67,59,0.08);
    transform: translateY(-2px);
}

.badge-active { background: rgba(107,158,107,0.12); color: #6B9E6B; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-inactive { background: rgba(184,112,112,0.1); color: #B87070; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-pending { background: rgba(196,169,90,0.12); color: #C4A95A; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-trial { background: rgba(107,93,82,0.08); color: #6B5D52; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; }

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #D8CCBC;
    border-radius: 10px;
}

/* User avatar in sidebar */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-user .user-info {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
}
#sidebar.expanded .sidebar-user .user-info {
    opacity: 1;
    transform: translateX(0);
}

/* Nav Label */
.nav-label {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 16px 12px 6px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease 0.1s;
    height: 0;
    overflow: hidden;
}
#sidebar.expanded .nav-label {
    opacity: 0.5;
    height: auto;
}
#sidebar.light .nav-label { color: #8A7D74; }

/* ============================================= */
/*            MODAL / OVERLAY SYSTEM             */
/* ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(46, 38, 34, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 60px rgba(46, 38, 34, 0.2);
}
.modal-content.wide {
    max-width: 720px;
}
.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}
.modal-content::-webkit-scrollbar {
    width: 4px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #D8CCBC;
    border-radius: 10px;
}

/* ============================================= */
/*               FORM ELEMENTS                   */
/* ============================================= */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3F352F;
    margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: #F8F5F1;
    border: 1px solid #E9DCCB;
    border-radius: 12px;
    font-size: 14px;
    color: #3F352F;
    outline: none;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #6B5D52;
    box-shadow: 0 0 0 3px rgba(107, 93, 82, 0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================= */
/*              BUTTONS                          */
/* ============================================= */
.btn-primary {
    background: #6B5D52;
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-family: 'Cairo', sans-serif;
}
.btn-primary:hover {
    background: #5C4F46;
    box-shadow: 0 4px 12px rgba(107, 93, 82, 0.25);
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-secondary {
    background: white;
    color: #3F352F;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #E9DCCB;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: 'Cairo', sans-serif;
}
.btn-secondary:hover {
    background: #F8F5F1;
}
.btn-danger {
    background: rgba(184,112,112,0.1);
    color: #B87070;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(184,112,112,0.2);
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: 'Cairo', sans-serif;
}
.btn-danger:hover {
    background: rgba(184,112,112,0.2);
}

/* ============================================= */
/*              TOAST NOTIFICATION               */
/* ============================================= */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #a67c52;
    color: white;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(46, 38, 34, 0.25);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.success {
    background: #4a7c4a;
}
.toast.error {
    background: #a05050;
}

/* ============================================= */
/*              TABS                             */
/* ============================================= */
.tabs {
    display: flex;
    gap: 4px;
    background: #F0EBE4;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
}
.tab-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #8A7D74;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}
.tab-btn.active {
    background: white;
    color: #3F352F;
    box-shadow: 0 1px 3px rgba(78,67,59,0.08);
}

/* ============================================= */
/*             PROGRESS BAR                      */
/* ============================================= */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #F0EBE4;
    border-radius: 100px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    border-radius: 100px;
    background: #6B5D52;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar .fill.success { background: #6B9E6B; }
.progress-bar .fill.warn { background: #C4A95A; }
.progress-bar .fill.danger { background: #B87070; }

/* ============================================= */
/*           TIMELINE                            */
/* ============================================= */
.timeline-item {
    position: relative;
    padding-right: 28px;
    padding-bottom: 20px;
}
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: #E9DCCB;
}
.timeline-dot {
    position: absolute;
    right: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #E9DCCB;
    background: white;
}
.timeline-dot.active { border-color: #6B9E6B; background: #6B9E6B; }
.timeline-dot.pending { border-color: #C4A95A; background: #C4A95A; }
.timeline-dot.danger { border-color: #B87070; background: #B87070; }

/* ============================================= */
/*           TOOLTIP                             */
/* ============================================= */
.tooltip {
    position: relative;
}
.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #2E2622;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.tooltip:hover::after {
    opacity: 1;
}

/* ============================================= */
/*           ANIMATIONS                          */
/* ============================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.animate-in {
    animation: fadeInUp 0.4s ease both;
}
.animate-pulse {
    animation: pulse 2s infinite;
}

/* ============================================= */
/*           UPLOAD / FILE                       */
/* ============================================= */
.upload-zone {
    border: 2px dashed #D8CCBC;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.upload-zone:hover {
    border-color: #6B5D52;
    background: rgba(107, 93, 82, 0.03);
}

/* ============================================= */
/*          MAP PLACEHOLDER                      */
/* ============================================= */
.map-placeholder {
    background: linear-gradient(135deg, #E9DCCB 0%, #D8CCBC 100%);
    border-radius: 16px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8A7D74;
    font-size: 14px;
    gap: 8px;
}
