/* ============================================================
   style.css  —  SCRAP CRM Stylesheet
   ============================================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; font-family:Arial,sans-serif; }

body { background:#f4f4f4; padding:10px; }

/* ── Header ── */
.header {
    display:flex; justify-content:space-between; align-items:center;
    background:#1C6936; color:white; 
    border-radius:8px; margin-bottom:15px; flex-wrap:wrap; gap:10px;
}
.header h2 { font-size:18px; }
.header-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* ── Stat cards ── */
.stats { display:flex; flex-wrap:wrap; gap:8px; }
.stat {
    background:white; color:black; padding:8px 14px; border-radius:5px;
    font-weight:bold; font-size:14px; min-width:130px; text-align:center;
}
.stat b { font-size:18px; color:#1C6936; display:block; }

/* ── Layout ── */
.main { display:flex; gap:15px; }
.left  { flex:1; background:white; padding:18px; border:2px solid #1C6936; border-radius:8px; }
.right { background:white; padding:18px; border:2px solid #1C6936; border-radius:8px; }

/* ── Form elements ── */
label { display:block; margin-bottom:4px; font-weight:bold; font-size:14px; }
input, select, textarea {
    width:100%; padding:8px; border:1px solid #ccc; border-radius:5px;
    margin-bottom:10px; font-size:14px;
}
input:focus, select:focus, textarea:focus {
    outline:none; border-color:#1C6936; box-shadow:0 0 0 2px rgba(0,123,255,0.15);
}
.form-row          { display:flex; gap:12px; }
.form-row > div    { flex:1; }
.small-row         { display:flex; gap:10px; }
.small-row > div   { flex:1; }

/* ── Buttons ── */
button {
    padding:12px 20px; border:none; border-radius:5px;
    cursor:pointer; font-weight:bold; margin:4px 3px; font-size:14px;
    transition: opacity .15s;
}
button:hover { opacity:.88; }
.btn-save   { background:#28a745; color:white; }
.btn-new    { background:#28a745; color:white; }
.btn-edit   { background:#28a745; color:white; padding:7px 12px; font-size:13px; }
.btn-del    { background:#dc3545; color:white; padding:7px 12px; font-size:13px; }
.btn-backup { background:#6c757d; color:white; }
.btn-logout { background:rgba(255,255,255,0.2); color:white; padding:8px 14px; font-size:16px; font-weight: 600; }

/* ── Checklist box ── */
.check { background:#1C6936; color:white; padding:14px; border-radius:8px; margin:15px 0; }
.check b { display:block; margin-bottom:10px; font-size:15px; }
.check label { display:flex; align-items:center; gap:8px; margin-bottom:8px; cursor:pointer; font-size:14px; font-weight:normal; }
.check input[type="checkbox"] { width:auto; margin-bottom:0; accent-color:#28a745; width:16px; height:16px; }

/* ── Final status check ── */
.final-check { background:#f8f9fa; padding:16px; border-radius:10px; border:1px solid #ddd; margin:18px 0; }
.final-check b { display:block; margin-bottom:12px; font-size:15px; color:white; }
.final-check label { display:flex; align-items:center; gap:10px; margin-bottom:12px; font-size:14.5px; font-weight:600; cursor:pointer; padding:4px 0; }
.final-check input[type="checkbox"] { width:18px; height:18px; accent-color:#28a745 ; margin-bottom:0; }

/* ── Status highlight ── */
.status-highlight { background:#e3f2fd; padding:12px; border-radius:6px; border:2px solid #2196F3; margin:15px 0; }
.status-highlight select { font-size:16px; font-weight:bold; padding:10px; }

/* ── Search box ── */
.small-search { margin-top:15px; padding:10px; background:#f8f9fa; border:1px solid #ccc; border-radius:6px; }
.small-search label { margin-bottom:6px; }
.small-search input { padding:10px; font-size:15px; margin-bottom:0; }

/* ── Orders table ── */
table { width:100%; border-collapse:collapse; margin-top:20px; background:white; }
th, td { border:1px solid #1C6936; padding:9px; text-align:center; font-size:13px; }
th { background:#1C6936; color:white; }
tr:nth-child(even) { background:#f0f5ff; }

/* ── Status badges ── */
.badge { display:inline-block; padding:3px 8px; border-radius:4px; font-size:12px; font-weight:bold; white-space:nowrap; }
.badge-new    { background:#cce5ff; color:#004085; }
.badge-docs   { background:#fff3cd; color:#856404; }
.badge-digi   { background:#d4edda; color:#155724; }
.badge-pickup { background:#fde2e2; color:#721c24; }
.badge-verif  { background:#e2cfff; color:#4b0082; }
.badge-cd     { background:#28a745; color:#000; }
.badge-refund { background:#fce8d5; color:#7a3b00; }
.badge-done   { background:#28a745; color:white; }

/* ── Document upload widgets ── */
.doc-upload-box {
    border:2px dashed #adb5bd; border-radius:8px;
    padding:10px 12px; margin-bottom:12px; background:#fafafa;
}
.doc-upload-box label.doc-label {
    font-size:13px; font-weight:bold; color:#1C6936; margin-bottom:6px; display:block;
}
.doc-upload-box input[type="file"] {
    width:100%; padding:4px; border:none; background:transparent;
    margin-bottom:4px; font-size:13px;
}
.doc-upload-box input[type="file"]::-webkit-file-upload-button {
    background:#28a745 ; color:white; border:none;
    padding:5px 10px; border-radius:4px; cursor:pointer; font-size:12px;
}
.doc-thumbnails { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.doc-thumb { position:relative; display:inline-block; }
.doc-thumb img {
    width:62px; height:62px; object-fit:cover;
    border-radius:5px; border:1px solid #ccc; cursor:pointer;
    transition: transform .15s;
}
.doc-thumb img:hover { transform:scale(1.08); }
.doc-file-icon {
    width:62px; height:62px; background:#e9ecef; border:1px solid #ccc;
    border-radius:5px; display:flex; flex-direction:column; align-items:center;
    justify-content:center; font-size:10px; color:#495057;
    text-align:center; cursor:pointer; padding:4px;
}
.doc-file-icon .icon-emoji { font-size:22px; line-height:1; margin-bottom:2px; }
.del-file {
    position:absolute; top:-6px; right:-6px;
    background:#dc3545; color:white; border:none; border-radius:50%;
    width:18px; height:18px; font-size:11px; cursor:pointer;
    line-height:18px; text-align:center; padding:0; font-weight:bold;
}
.doc-count { font-size:12px; color:#6c757d; margin-top:4px; }
.uploading-indicator { font-size:12px; color:#28a745 ; margin-top:4px; display:none; }

/* ── Lightbox ── */
#lightbox {
    display:none; position:fixed; top:0; left:0; width:100%; height:100%;
    background:#333333 z-index:99999;
    align-items:center; justify-content:center;
}
#lightbox img { max-width:90vw; max-height:90vh; border-radius:8px; box-shadow:0 4px 30px rgba(0,0,0,0.5); }
.lb-close {
    position:absolute; top:18px; right:26px;
    color:white; font-size:38px; cursor:pointer; font-weight:bold; line-height:1;
}

/* ── Lock Screen ── */
#lockScreen {
    position:fixed; top:0; left:0; width:100%; height:100%;
    background:#333333; display:none;
    align-items:center; justify-content:center; z-index:9999;
}
.lock-box {
    background:white; padding:36px; border-radius:14px;
    width:360px; text-align:center; box-shadow:0 10px 40px #333333;
}
.lock-box h2 { margin-bottom:8px; color:#28a745 ; font-size:22px; }
.lock-box p  { color:#333333; margin-bottom:14px; font-size:14px; }
.lock-box input {
    width:100%; padding:14px; font-size:16px;
    margin-bottom:12px; border:1px solid #ccc; border-radius:6px;
}
.lock-box .btn-unlock {
    width:100%; padding:14px; background:#28a745 ; color:white;
    border:none; border-radius:6px; font-size:16px; cursor:pointer; margin-bottom:8px;
}
.lock-box .btn-changepw { width:100%; background:#6c757d; color:white; font-size:14px; padding:10px; }
#changePwSection { display:none; margin-top:14px; border-top:1px solid #eee; padding-top:14px; }
#changePwSection input { margin-bottom:8px; }

/* ── Toast ── */
#toast {
    position:fixed; bottom:30px; left:50%; transform:translateX(-50%) translateY(80px);
    background:white; color:white; padding:12px 24px; border-radius:8px;
    font-size:14px; z-index:99999; transition:transform .3s ease, opacity .3s ease;
    opacity:0; pointer-events:none; white-space:nowrap;
}
#toast.show { transform:translateX(-50%) translateY(0); opacity:1; }
#toast.success { background:#28a745; }
#toast.error   { background:#dc3545; }

/* ── Loading spinner ── */
#loadingOverlay {
    display:none; position:fixed; top:0; left:0; width:100%; height:100%;
    background:rgba(255,255,255,0.7); z-index:9998; align-items:center; justify-content:center;
}
.spinner {
    width:48px; height:48px; border:5px solid #e0e0e0;
    border-top-color:#28a745 ; border-radius:50%; animation:spin .8s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 900px) {
    .main { flex-direction:column; }
    .right { width:100%; }
}
@media (max-width: 600px) {
    .form-row, .small-row { flex-direction:column; gap:0; }
    .stats { gap:6px; }
    .stat  { min-width:100px; font-size:12px; }
}
