/* ============================================================
   REPAIR CRM — GLOBAL STYLESHEET
   Apply on every page via:
   <link rel="stylesheet" href="/repair_crm/assets/css/global.css">
============================================================ */

/* ── Google Font: Poppins ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Base Reset ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: 'Poppins', sans-serif !important;
    font-size: 16px;
    background: #eef1f6;
    color: #1e293b;
    overflow-x: hidden;
}

body {
    zoom: 0.90;
}

/* Force Poppins on all common elements */
h1, h2, h3, h4, h5, h6,
p, a, span, label, input,
select, textarea, button,
td, th, li, div {
    font-family: 'Poppins', sans-serif !important;
}

/* ── MAIN CONTENT AREA ────────────────────────────────────── */
.main {
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
    transition: margin-left 0.25s ease, width 0.25s ease;
    width: calc(100% - 260px);
    box-sizing: border-box;
}

/* When sidebar is collapsed */
.main.collapsed {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* ── SIDEBAR TOGGLE ARROW BUTTON ─────────────────────────── */
#sidebarToggle {
    cursor: pointer;
    transition: transform 0.25s ease;
}

#sidebarToggle.rotated {
    transform: rotate(180deg);
}

/* ── CARDS ────────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 28px;
    border-radius: 14px;
    margin-bottom: 26px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #1e293b;
}

/* ── INPUTS ───────────────────────────────────────────────── */
.input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif !important;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-save,
.btn-primary-crm {
    padding: 11px 22px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    transition: background 0.2s;
}

.btn-save:hover,
.btn-primary-crm:hover {
    background: #1d4ed8;
}

.btn-cancel,
.btn-secondary-crm {
    padding: 11px 22px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    transition: background 0.2s;
}

.btn-cancel:hover,
.btn-secondary-crm:hover {
    background: #e2e8f0;
}

.btn-mini {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 13px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.2s;
}

.btn-mini:hover {
    background: #1d4ed8;
}

/* ── FORM GROUP ───────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* ── UPLOAD BOX ───────────────────────────────────────────── */
.upload-box {
    border: 2px dashed #93c5fd;
    background: #f8fafc;
    padding: 30px 20px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    transition: border-color 0.2s, background 0.2s;
}

.upload-box:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-box i {
    font-size: 36px;
    color: #2563eb;
    margin-bottom: 8px;
    display: block;
}

/* ── MODAL OVERLAY ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    width: 460px;
    max-width: 95vw;
    padding: 28px;
    border-radius: 16px;
    animation: slideUp 0.25s ease-out;
    font-family: 'Poppins', sans-serif !important;
}

.modal-xl {
    width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ef4444;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.save-btn {
    padding: 10px 26px;
    background: #2563eb;
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 500;
    transition: background 0.2s;
}

.save-btn:hover { background: #1d4ed8; }

.cancel-btn {
    padding: 10px 26px;
    background: #fff;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 500;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #fee2e2;
}

/* ── TOAST NOTIFICATION ───────────────────────────────────── */
.crm-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 13px 20px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    z-index: 99999;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif !important;
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.crm-toast.error   { background: #ef4444; box-shadow: 0 6px 20px rgba(239,68,68,0.35); }
.crm-toast.success { background: #16a34a; box-shadow: 0 6px 20px rgba(22,163,74,0.35); }
.crm-toast.warning { background: #f59e0b; box-shadow: 0 6px 20px rgba(245,158,11,0.35); }

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

/* ── TABLES ───────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f8faff;
}

/* ── BADGES ───────────────────────────────────────────────── */
.badge-inward   { background:#dbeafe; color:#1d4ed8; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.badge-progress { background:#fef9c3; color:#92400e; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.badge-done     { background:#dcfce7; color:#166534; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.badge-delivered{ background:#f0fdf4; color:#15803d; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.badge-urgent   { background:#fee2e2; color:#dc2626; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:500; }

/* ── INPUT + BUTTON INLINE ────────────────────────────────── */
.input-plus {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-plus input,
.input-plus select {
    flex: 1;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .main {
        margin-left: 0 !important;
        padding: 16px;
    }
}
