@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@theme {
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol', 'Noto Color Emoji';
}

/* ------------------------------
   DABBA DIRECT BRAND PALETTE
   (picked from your logo)
   ------------------------------ */
:root{
    /* Main (light) */
    --bg: #f5f7ff;
    --panel: #ffffff;
    --panel-2: #ffffff;

    --text: #111a2e;
    --muted: #5f6b85;
    --border: rgba(17,26,46,.10);

    /* Brand accents (from logo) */
    --accent: #077be0;   /* bright blue */
    --accent-2: #7c178b; /* purple */
    --accent-3: #bc6ebf; /* pink-ish purple */

    --shadow: 0 12px 28px rgba(17,26,46,.10);

    /* Sidebar (dark) */
    --sidebar-bg: #0b1220;
    --sidebar-bg-2: #0c1d92;   /* deep blue from logo */
    --sidebar-bg-3: #4c045d;   /* deep purple from logo */
    --sidebar-text: #ededf4;
    --sidebar-muted: rgba(237,237,244,.75);
    --sidebar-border: rgba(255,255,255,.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
    background:
        radial-gradient(1200px 600px at 20% 0%, rgba(7,123,224,.12), transparent 55%),
        radial-gradient(900px 500px at 70% 10%, rgba(124,23,139,.10), transparent 50%),
        var(--bg);
    color: var(--text);
}

.layout{ display:flex; min-height:100vh; }

/* ---------------- Sidebar (dark) ---------------- */
.sidebar{
    width: 270px;
    background:
        radial-gradient(900px 520px at 30% 0%, rgba(7,123,224,.22), transparent 55%),
        radial-gradient(780px 480px at 80% 15%, rgba(124,23,139,.22), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,.04), transparent 45%),
        var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 18px 14px;
}

.brand{ display:flex; gap:12px; align-items:center; padding:10px 10px 18px; }
.brand-mark{
    width:38px; height:38px; border-radius:12px;
    display:grid; place-items:center;
    background: linear-gradient(135deg, rgba(7,123,224,.35), rgba(188,110,191,.25));
    border: 1px solid var(--sidebar-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    font-weight:800;
    color: var(--sidebar-text);
}
.brand-title{ font-weight:800; letter-spacing:.2px; color: var(--sidebar-text); }
.brand-subtitle{ color:var(--sidebar-muted); font-size:12px; margin-top:2px; }

.nav{ display:flex; flex-direction:column; gap:6px; padding: 0 6px; }
.nav-section{ color:var(--sidebar-muted); font-size:12px; margin:14px 6px 6px; letter-spacing:.12em; }

.nav-item{
    display:block;
    padding:10px 10px;
    border-radius:12px;
    color: var(--sidebar-text);
    text-decoration:none;
    border: 1px solid transparent;
}
.nav-item:hover{
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.10);
}
.nav-item.active{
    background: linear-gradient(135deg, rgba(7,123,224,.18), rgba(124,23,139,.16));
    border-color: rgba(7,123,224,.30);
}
.nav-spacer{ flex:1; }

/* ---------------- Main ---------------- */
.main{ flex:1; display:flex; flex-direction:column; }

.topbar{
    height:64px;
    display:flex;
    align-items:center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(10px);
}
.topbar-title{ font-weight:800; }

.content{ padding: 22px 24px; }

.card{
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    max-width: 980px;
}

.h1{ font-size:26px; margin: 0 0 12px; }
.p{ margin:0; color: var(--muted); line-height:1.5; }

/* ---------------- Form styling ---------------- */
.form-group{ margin-bottom:14px; }
.form-group label{
    display:block;
    margin-bottom:6px;
    font-size:13px;
    color:var(--muted);
}
.form-input,
.form-select,
.form-textarea{
    width:100%;
    padding:10px 12px;
    border-radius:10px;
    background: rgba(17,26,46,.03);
    border:1px solid var(--border);
    color:var(--text);
    outline:none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus{
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(7,123,224,.12);
}
.form-row{ display:flex; gap:12px; }
.form-actions{
    display:flex;
    gap:10px;
    align-items:center;
    margin-top:16px;
}

.btn-primary{
    padding:10px 16px;
    border-radius:12px;
    border:1px solid rgba(7,123,224,.35);
    background: linear-gradient(135deg, rgba(7,123,224,.18), rgba(124,23,139,.14));
    color: var(--text);
    cursor:pointer;
}
.btn-link{ color:var(--muted); text-decoration:none; }

.btn-secondary{
    padding:8px 14px;
    border-radius:10px;
    border:1px dashed rgba(17,26,46,.25);
    background: rgba(17,26,46,.02);
    color: var(--muted);
    cursor:pointer;
}
.btn-secondary:hover{
    border-color: var(--accent);
    color: var(--text);
    background: rgba(7,123,224,.05);
}

/* Customer detail polish */
.page-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    margin-bottom:16px;
    max-width:1100px;
}
.page-head__title .h1{ margin:0 0 6px; }
.page-sub{ display:flex; flex-wrap:wrap; gap:8px; color:var(--muted); font-size:13px; }

.page-head__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}


.chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid var(--border);
    background: rgba(17,26,46,.02);
}

/* Grid */
.page-grid{
    display:grid;
    grid-template-columns: 1fr;
    gap:16px;
    max-width:1100px;
}
@media (min-width: 980px){
    .page-grid{ grid-template-columns: 1fr 1fr; }
    .page-span-2{ grid-column: 1 / span 2; }
}

.h2{ margin:0; font-size:16px; letter-spacing:.2px; }
.card-head{ margin-bottom:12px; }
.card-head--split{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
}
.muted-sm{ color:var(--muted); font-size:13px; }

/* Key/Value grid */
.kv{ display:grid; gap:10px; }
.kv-row{
    display:grid;
    grid-template-columns: 160px 1fr;
    gap:12px;
    align-items:start;
}
.kv-label{ color:var(--muted); font-size:13px; padding-top:2px; }
.kv-value{ color:var(--text); }
.kv-pre{ white-space:pre-wrap; }

/* Modal helpers */
.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:9999;
}
.modal-card{ width:min(720px, 100%); }
.error-text{ color:#b42318; font-size:13px; margin-top:6px; }

/* Tiny badges */
.badge{
    display:inline-flex;
    align-items:center;
    padding:3px 8px;
    border-radius:999px;
    font-size:12px;
    line-height:1;
    border:1px solid var(--border);
    background: rgba(17,26,46,.02);
    color: var(--muted);
    margin-left:10px;
    vertical-align:middle;
}
.badge-primary{
    color: var(--text);
    border-color: rgba(7,123,224,.25);
    background: linear-gradient(135deg, rgba(7,123,224,.10), rgba(124,23,139,.08));
}

/* Address meta line */
.addr-meta{
    margin-top:8px;
    color:var(--muted);
    font-size:13px;
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}
.addr-meta .dot{ opacity:.8; }

/* Timeline notes */
.timeline{
    position:relative;
    display:grid;
    gap:14px;
    margin-top:4px;
}
.t-item{
    position:relative;
    display:grid;
    grid-template-columns: 18px 1fr;
    gap:12px;
    align-items:start;
}
.t-dot{
    width:12px;
    height:12px;
    border-radius:999px;
    margin-top:6px;
    background: linear-gradient(135deg, rgba(7,123,224,.95), rgba(124,23,139,.90));
    box-shadow: 0 0 0 4px rgba(7,123,224,.10);
}
.t-item:before{
    content:"";
    position:absolute;
    left:5px;
    top:20px;
    bottom:-12px;
    width:2px;
    background: rgba(17,26,46,.08);
}
.t-item:last-child:before{ display:none; }

.t-meta{
    color:var(--muted);
    font-size:12px;
    margin-bottom:6px;
}
.t-card{
    padding:10px 12px;
    border-radius:12px;
    border:1px solid var(--border);
    background: rgba(17,26,46,.02);
}

/* Small button size (used on Edit buttons) */
.btn-xs{
    padding:6px 10px;
    border-radius:10px;
    font-size:12px;
}

/* Notes actions */
.t-actions{ margin-left:auto; display:flex; gap:10px; align-items:center; }
.btn-mini{
    font-size:12px;
    padding:0;
    border:0;
    background:transparent;
    cursor:pointer;
    text-decoration:none;
}
.btn-link.btn-mini{ color: var(--muted); }
.btn-link.btn-mini:hover{ color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.btn-link.btn-mini.danger{ color:#b42318; opacity:.9; }
.btn-link.btn-mini.danger:hover{ color:#7a271a; }

/* Note highlight flash */
.note-flash .t-card{
    border-color: rgba(7,123,224,.35);
    box-shadow: 0 0 0 2px rgba(7,123,224,.10), var(--shadow);
    background: linear-gradient(135deg, rgba(7,123,224,.06), rgba(124,23,139,.05));
    animation: noteFlash 1.6s ease-out;
}
@keyframes noteFlash{
    0% { transform: translateY(-1px); }
    100% { transform: translateY(0); }
}

/* Read more / collapse */
.note-details{ margin:0; }
.note-details summary{ list-style:none; cursor:pointer; user-select:none; }
.note-details summary::-webkit-details-marker{ display:none; }
.note-summary{ display:flex; gap:12px; align-items:flex-start; }
.note-preview{ flex:1; white-space: pre-wrap; }
.note-toggle{
    flex:none;
    font-size:12px;
    color: var(--accent);
    opacity:.9;
    padding-top:2px;
}
.note-details[open] .note-toggle{ color: var(--muted); }
.note-full{ margin-top:10px; white-space: pre-wrap; }

/* Customers list (CRM-style) */
.customers-list{ display:grid; gap:10px; margin-top:6px; }

.customer-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:12px 12px;
    border-radius:14px;
    border:1px solid var(--border);
    background: rgba(17,26,46,.02);
    text-decoration:none;
    color: var(--text);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.customer-row:hover{
    background: rgba(7,123,224,.04);
    border-color: rgba(7,123,224,.20);
    transform: translateY(-1px);
}

.customer-row__left{ min-width:0; display:grid; gap:6px; }
.customer-name{
    font-weight:800;
    letter-spacing:.2px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:760px;
}
.customer-meta{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.customer-row__right{
    display:flex;
    gap:10px;
    align-items:center;
    flex:0 0 auto;
}
@media (max-width:680px){
    .customer-row__right{ display:none; }
    .customer-name{ max-width:100%; }
}

/* Customers stats row */
.stats-row{
    display:grid;
    grid-template-columns: 1fr;
    gap:12px;
}
@media (min-width: 980px){
    .stats-row{ grid-template-columns: repeat(3, 1fr); }
}
.stat-card{
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.stat-label{ color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat-value{ font-size: 22px; font-weight: 900; letter-spacing: .2px; }

/* Active chip state */
.chip{ cursor:pointer; }
.chip--active{
    background: linear-gradient(135deg, rgba(7,123,224,.10), rgba(124,23,139,.08));
    border-color: rgba(7,123,224,.22);
    color: var(--text);
}
