/* =====================================================
   Laraware CRM — Brand Theme
   Color palette from laraware.com (Indigo/Violet)
   ===================================================== */

/* ── Brand Variables ── */
:root {
    --lw-primary:       #6366F1;
    --lw-primary-light: #818CF8;
    --lw-primary-dark:  #4F46E5;
    --lw-primary-deeper:#4338CA;
    --lw-accent:        #A5B4FC;
    --lw-accent-soft:   #E8EAFF;
    --lw-accent-glow:   rgba(99,102,241,0.15);
    --lw-dark:          #1E1B4B;
    --lw-dark-mid:      #312E81;
    --lw-surface:       #f8f9fc;
    --lw-success:       #10b981;
    --lw-warning:       #f59e0b;
    --lw-danger:        #ef4444;
    --lw-info:          #60A5FA;
    --lw-text:          #1e293b;
    --lw-text-muted:    #64748b;
    --lw-border:        #e2e8f0;
    --lw-radius:        10px;
    --lw-radius-lg:     14px;
    --lw-shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
    --lw-shadow-md:     0 4px 16px rgba(99,102,241,0.08);
    --lw-shadow-lg:     0 8px 30px rgba(99,102,241,0.12);
}

/* ══════════════════════════════════════════════════════
   1. GLOBAL ELEMENTS
   ══════════════════════════════════════════════════════ */

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--lw-text);
    background: var(--lw-surface);
}

a { color: var(--lw-primary); transition: color .15s; }
a:hover, a:focus { color: var(--lw-primary-dark); }

::selection { background: var(--lw-accent-soft); color: var(--lw-dark); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:#f1f1f1; }
::-webkit-scrollbar-thumb { background:var(--lw-primary-light); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--lw-primary); }

/* ══════════════════════════════════════════════════════
   2. SIDEBAR
   ══════════════════════════════════════════════════════ */

/* Dark sidebar gradient */
#menu.sidebar {
    background: linear-gradient(180deg, var(--lw-dark) 0%, var(--lw-dark-mid) 100%) !important;
}

/* Sidebar text */
#menu.sidebar .nav > li > a,
#menu.sidebar .nav-second-level > li > a {
    color: rgba(255,255,255,0.72) !important;
    transition: all .2s;
}
#menu.sidebar .nav > li > a:hover,
#menu.sidebar .nav > li > a:focus,
#menu.sidebar .nav-second-level > li > a:hover {
    color: #fff !important;
    background: rgba(99,102,241,0.12) !important;
}
#menu.sidebar .nav > li.active > a {
    color: #fff !important;
    background: rgba(99,102,241,0.18) !important;
    border-left: 3px solid var(--lw-accent) !important;
}
#menu.sidebar .nav > li.active > a .menu-icon {
    color: var(--lw-accent) !important;
}

/* Menu icons */
#menu.sidebar .menu-icon { color: rgba(165,180,252,0.6); transition: color .2s; }
#menu.sidebar .nav > li > a:hover .menu-icon,
#menu.sidebar .nav > li.active > a .menu-icon {
    color: var(--lw-accent) !important;
}

/* Sidebar profile card */
.sidebar-user-profile .dropdown-toggle.profile {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}
.sidebar-user-profile .dropdown-toggle.profile:hover {
    background: rgba(99,102,241,0.15) !important;
    border-color: rgba(165,180,252,0.25) !important;
}
.sidebar-user-profile .dropdown-toggle.profile span {
    color: #fff !important;
}
.sidebar-user-profile .dropdown-toggle.profile .tw-text-neutral-500,
.sidebar-user-profile .dropdown-toggle.profile .tw-text-neutral-300 {
    color: rgba(165,180,252,0.7) !important;
}

/* Sidebar profile image ring */
#sidebar .sidebar-profile-image,
.sidebar-user-profile .staff-profile-image-small {
    border: 2px solid var(--lw-accent) !important;
    border-radius: 50%;
}

/* Sub-menu background */
#menu.sidebar .nav-second-level {
    background: rgba(0,0,0,0.15) !important;
}

/* ══════════════════════════════════════════════════════
   3. TOP NAVBAR / HEADER
   ══════════════════════════════════════════════════════ */

#header {
    background: #fff !important;
    border-bottom: 2px solid var(--lw-accent-soft) !important;
    box-shadow: 0 1px 4px rgba(99,102,241,0.06);
}

/* Logo area */
#logo a.logo-text {
    color: var(--lw-dark) !important;
    font-weight: 700;
}

/* Quick-create button */
#header .navbar-nav .tw-bg-primary-600 {
    background: var(--lw-primary) !important;
}
#header .navbar-nav .group-hover\:tw-bg-primary-700:hover,
#header .navbar-nav .tw-bg-primary-600:hover {
    background: var(--lw-primary-dark) !important;
}

/* Search input */
#top_search #search_input {
    border-radius: var(--lw-radius) !important;
    background: var(--lw-surface) !important;
    border: 1px solid var(--lw-border) !important;
}
#top_search #search_input:focus {
    border-color: var(--lw-primary-light) !important;
    box-shadow: 0 0 0 3px var(--lw-accent-glow) !important;
}

/* ══════════════════════════════════════════════════════
   4. BUTTONS
   ══════════════════════════════════════════════════════ */

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled {
    background: linear-gradient(135deg, var(--lw-primary), var(--lw-primary-light)) !important;
    border-color: var(--lw-primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
    border-radius: var(--lw-radius);
    font-weight: 600;
    transition: all .2s;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, var(--lw-primary-dark), var(--lw-primary)) !important;
    border-color: var(--lw-primary-dark) !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35) !important;
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-info {
    background: var(--lw-info) !important;
    border-color: var(--lw-info) !important;
}

.btn-success {
    background: var(--lw-success) !important;
    border-color: var(--lw-success) !important;
}

.btn-default, .btn-default:focus {
    border-radius: var(--lw-radius);
    border-color: var(--lw-border);
}
.btn-default:hover {
    border-color: var(--lw-primary-light);
    color: var(--lw-primary);
}

/* ══════════════════════════════════════════════════════
   5. CARDS & PANELS
   ══════════════════════════════════════════════════════ */

.panel_s,
.panel-default {
    border: none !important;
    border-radius: var(--lw-radius-lg) !important;
    box-shadow: var(--lw-shadow-sm) !important;
    overflow: hidden;
    transition: box-shadow .2s;
}
.panel_s:hover {
    box-shadow: var(--lw-shadow-md) !important;
}

.panel_s > .panel-heading,
.panel-default > .panel-heading {
    background: #fff !important;
    border-bottom: 1px solid var(--lw-border) !important;
    font-weight: 600;
    color: var(--lw-text);
}

.panel_s > .panel-body { background: #fff; }

/* ══════════════════════════════════════════════════════
   6. DASHBOARD WIDGETS / TOP STATS
   ══════════════════════════════════════════════════════ */

.top_stats_wrapper {
    border-radius: var(--lw-radius-lg);
    border: 1px solid var(--lw-border);
    background: #fff;
    transition: all .25s;
    overflow: hidden;
}
.top_stats_wrapper:hover {
    box-shadow: var(--lw-shadow-md);
    border-color: var(--lw-accent);
    transform: translateY(-2px);
}

/* Stats number accent */
.top_stats_wrapper .text-primary,
.top_stats_wrapper .text-info,
.widget .text-primary {
    color: var(--lw-primary) !important;
}

/* ══════════════════════════════════════════════════════
   7. TABLES
   ══════════════════════════════════════════════════════ */

.table > thead > tr > th {
    background: var(--lw-surface);
    border-bottom: 2px solid var(--lw-accent-soft) !important;
    color: var(--lw-text);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: rgba(248,249,252,0.6);
}

.table > tbody > tr:hover {
    background: var(--lw-accent-soft) !important;
}

/* ══════════════════════════════════════════════════════
   8. BADGES & LABELS
   ══════════════════════════════════════════════════════ */

.label-primary, .bg-primary { background-color: var(--lw-primary) !important; }
.label-info, .bg-info { background-color: var(--lw-info) !important; }
.label-success, .bg-success { background-color: var(--lw-success) !important; }
.label-warning, .bg-warning { background-color: var(--lw-warning) !important; }
.label-danger, .bg-danger { background-color: var(--lw-danger) !important; }

.label {
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 600;
    font-size: 11px;
}

/* ══════════════════════════════════════════════════════
   9. FORMS
   ══════════════════════════════════════════════════════ */

.form-control {
    border: 1.5px solid var(--lw-border);
    border-radius: var(--lw-radius);
    padding: 8px 12px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    border-color: var(--lw-primary-light) !important;
    box-shadow: 0 0 0 3px var(--lw-accent-glow) !important;
    outline: none;
}

/* ══════════════════════════════════════════════════════
   10. PROGRESS BARS
   ══════════════════════════════════════════════════════ */

.progress {
    border-radius: 10px;
    background: var(--lw-accent-soft);
    overflow: hidden;
    height: 8px;
}
.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--lw-primary), var(--lw-primary-light));
}
.progress-bar-success { background: linear-gradient(90deg, #059669, var(--lw-success)); }

/* ══════════════════════════════════════════════════════
   11. TABS & NAV
   ══════════════════════════════════════════════════════ */

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
    border-bottom: 2px solid var(--lw-primary) !important;
    color: var(--lw-primary) !important;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   12. PAGINATION
   ══════════════════════════════════════════════════════ */

.pagination > .active > a,
.pagination > .active > a:focus,
.pagination > .active > a:hover {
    background: var(--lw-primary) !important;
    border-color: var(--lw-primary) !important;
    color: #fff;
}
.pagination > li > a { color: var(--lw-primary); border-radius: 6px; margin: 0 2px; }
.pagination > li > a:hover { background: var(--lw-accent-soft); color: var(--lw-primary-dark); }

/* ══════════════════════════════════════════════════════
   13. DROPDOWN MENUS
   ══════════════════════════════════════════════════════ */

.dropdown-menu {
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius);
    box-shadow: var(--lw-shadow-lg);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background: var(--lw-accent-soft) !important;
    color: var(--lw-primary-dark) !important;
}

/* ══════════════════════════════════════════════════════
   14. ALERTS
   ══════════════════════════════════════════════════════ */

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: var(--lw-accent-soft); border-color: var(--lw-accent); color: var(--lw-dark); }

.alert { border-radius: var(--lw-radius); }

/* ══════════════════════════════════════════════════════
   15. MODALS
   ══════════════════════════════════════════════════════ */

.modal-content {
    border: none;
    border-radius: var(--lw-radius-lg);
    box-shadow: var(--lw-shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--lw-border);
    padding: 16px 24px;
}
.modal-header .modal-title { font-weight: 700; color: var(--lw-dark); }
.modal-footer { border-top: 1px solid var(--lw-border); }

/* ══════════════════════════════════════════════════════
   16. TOOLTIP & POPOVER
   ══════════════════════════════════════════════════════ */

.tooltip-inner {
    background: var(--lw-dark);
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 10px;
}

/* ══════════════════════════════════════════════════════
   17. CHECKBOX & RADIO (Perfex overrides)
   ══════════════════════════════════════════════════════ */

.checkbox input[type="checkbox"]:checked + label::before,
input[type="checkbox"]:checked + label::before {
    background-color: var(--lw-primary) !important;
    border-color: var(--lw-primary) !important;
}

/* ══════════════════════════════════════════════════════
   18. CALENDAR / TODO / MISC WIDGETS
   ══════════════════════════════════════════════════════ */

.fc-button-primary {
    background: var(--lw-primary) !important;
    border-color: var(--lw-primary) !important;
}
.fc-button-primary:hover {
    background: var(--lw-primary-dark) !important;
}
.fc-today { background: var(--lw-accent-soft) !important; }

/* ══════════════════════════════════════════════════════
   19. CONTENT WRAPPER
   ══════════════════════════════════════════════════════ */

#wrapper > .content { background: var(--lw-surface); }

/* ══════════════════════════════════════════════════════
   20. SCREEN OPTIONS / DASHBOARD OPTIONS
   ══════════════════════════════════════════════════════ */

.screen-options-btn {
    color: var(--lw-primary);
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius);
    background: #fff;
}
.screen-options-btn:hover {
    background: var(--lw-accent-soft);
    border-color: var(--lw-primary-light);
}

/* ══════════════════════════════════════════════════════
   21. TEXT UTILITIES
   ══════════════════════════════════════════════════════ */

.text-primary { color: var(--lw-primary) !important; }
.text-success { color: var(--lw-success) !important; }
.text-danger  { color: var(--lw-danger) !important; }
.text-warning { color: var(--lw-warning) !important; }
.text-info    { color: var(--lw-info) !important; }

/* ══════════════════════════════════════════════════════
   22. LARAWARE FOOTER BRANDING
   ══════════════════════════════════════════════════════ */

#footer,
.footer-branding {
    border-top: 1px solid var(--lw-border);
}

/* ══════════════════════════════════════════════════════
   23. LOADING / SPINNER
   ══════════════════════════════════════════════════════ */

.dt-loader {
    border-top-color: var(--lw-primary) !important;
}

/* ══════════════════════════════════════════════════════
   24. TAILWIND PRIMARY OVERRIDES
   ══════════════════════════════════════════════════════ */

.tw-bg-primary-600 { background-color: var(--lw-primary) !important; }
.tw-bg-primary-700 { background-color: var(--lw-primary-dark) !important; }
.tw-text-primary-600 { color: var(--lw-primary) !important; }
.tw-border-primary-600 { border-color: var(--lw-primary) !important; }
.hover\:tw-bg-primary-700:hover { background-color: var(--lw-primary-dark) !important; }

/* ══════════════════════════════════════════════════════
   25. SMOOTH TRANSITIONS
   ══════════════════════════════════════════════════════ */

.panel_s, .top_stats_wrapper, .btn, .form-control, .nav-tabs > li > a,
.dropdown-menu > li > a, .label, .badge {
    transition: all .2s ease;
}
