/* ═══════════════════════════════════════
   MY Work Pro — Custom Styles
   ═══════════════════════════════════════ */

:root {
    --sidebar-bg: #1a1a2e;
    --sidebar-fg: #a8b2d1;
    --sidebar-active: #0f3460;
    --sidebar-hover: #16213e;
    --sidebar-width: 260px;
    --content-bg: #f3f5f9;
    --primary: #4361ee;
    --primary-dark: #3049c7;
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e63946;
    --accent: #7209b7;
    --text-dark: #2b2d42;
    --text-muted: #8d99ae;
    --header-h: 60px;
    --status-h: 32px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(20, 25, 50, 0.05);
    --shadow-md: 0 6px 20px rgba(20, 25, 50, 0.08);
    --shadow-lg: 0 12px 32px rgba(20, 25, 50, 0.12);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--content-bg);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

/* ═══ CONTENT FADE-IN (subtle page transition) ═══ */
.content-area {
    animation: contentFadeIn 0.35s ease;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    z-index: 1080;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
}

.brand-badge {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.3);
    padding: 18px 24px 8px;
    text-transform: uppercase;
}

.sidebar-nav {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
    padding-left: 20px;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, var(--sidebar-active), rgba(67, 97, 238, 0.25));
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(67, 97, 238, 0.25);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-stats {
    padding: 12px 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer {
    padding: 10px 20px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
    text-align: center;
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ═══ TOP HEADER ═══ */
.top-header {
    background: white;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #e9ebf0;
    position: sticky;
    top: 0;
    z-index: 1050;
    box-shadow: var(--shadow-sm);
}

.top-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--success));
    opacity: 0.6;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.page-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.page-subtitle {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.header-search input {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 7px 14px 7px 34px;
    font-size: 0.85rem;
    width: 300px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--content-bg);
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: white;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1100;
    margin-top: 4px;
}

.search-group {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-group:last-child {
    border-bottom: none;
}

.search-group-title {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.search-item {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    transition: background 0.15s;
}

.search-item:hover {
    background: var(--content-bg);
    color: var(--primary);
}

.header-clock {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ═══ CONTENT AREA ═══ */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ═══ STATUS BAR ═══ */
.status-bar {
    background: var(--text-dark);
    color: rgba(255,255,255,0.6);
    height: var(--status-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* ═══ STAT CARDS (dashboard) ═══ */
.stat-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(20,25,50,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-accent {
    height: 4px;
}

.stat-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
}

.stat-icon {
    font-size: 1.8rem;
    opacity: 0.85;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}

/* ═══ CLIENT/EMPLOYEE CARDS ═══ */
.client-card, .card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: var(--radius-md);
}

.card {
    border: 1px solid rgba(20,25,50,0.05);
}

.card.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
}

.card-accent {
    height: 4px;
    border-radius: 4px 4px 0 0;
}

.card-header {
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ═══ TOASTS ═══ */
.toast {
    border-radius: 10px;
    min-width: 300px;
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ═══ TABLE STYLING ═══ */
.table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom-width: 1px;
}

.table td {
    font-size: 0.88rem;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(67, 97, 238, 0.04);
}

.table-light {
    --bs-table-bg: #f8f9fc;
}

/* ═══ FORM STYLING ═══ */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #dde1e8;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block !important;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1070;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .header-search input {
        width: 180px;
    }
    .header-clock {
        display: none;
    }
    .live-status {
        display: none;
    }
    .cmdk-trigger {
        display: none;
    }
    .page-subtitle {
        display: none;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
}

/* ═══ BADGE PILLS ═══ */
.badge {
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge.rounded-pill {
    font-weight: 600;
    font-size: 0.75rem;
}

/* ═══ MODAL STYLING ═══ */
.modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.modal-header {
    border-bottom: none;
    padding: 16px 24px;
}

.modal-body {
    padding: 20px 24px;
}

/* ═══ BTN STYLING ═══ */
.btn {
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary-dark);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.3);
}

.btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-secondary {
    font-weight: 600;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* ═══ CARD HEADER DARK ═══ */
.card-header.bg-dark {
    background: var(--text-dark) !important;
    border-radius: 0;
    font-size: 0.88rem;
    font-weight: 600;
}

/* ═══ DROPDOWN ═══ */
.dropdown-menu {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 6px;
}

.dropdown-item {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 8px 14px;
}

.dropdown-item:hover {
    background: var(--content-bg);
}

/* ═══ MISC ═══ */
.comp-display {
    font-weight: 500;
    color: var(--text-dark);
}

/* ═══ TOP PAGE-LOAD PROGRESS BAR ═══ */
.top-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--success));
    z-index: 3000;
    transition: width 0.6s ease, opacity 0.2s ease;
    box-shadow: 0 0 8px rgba(67, 97, 238, 0.6);
}

/* ═══ TOAST-STYLE FLASH NOTIFICATIONS ═══ */
.toast-stack {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 2000;
    width: 360px;
    max-width: calc(100vw - 40px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-alert {
    animation: slideInRight 0.35s ease;
    box-shadow: var(--shadow-lg) !important;
    margin-bottom: 0 !important;
}

/* ═══ COMMAND PALETTE TRIGGER (header) ═══ */
.cmdk-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--content-bg);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.cmdk-trigger:hover {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.cmdk-trigger i {
    color: var(--accent);
}

.cmdk-trigger kbd {
    background: white;
    border: 1px solid #d7dae0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-family: inherit;
    color: var(--text-dark);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* ═══ COMMAND PALETTE OVERLAY ═══ */
.cmdk-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 30, 0.55);
    backdrop-filter: blur(2px);
    z-index: 3050;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.cmdk-overlay.show {
    display: flex;
}

.cmdk-box {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(0,0,0,0.4);
    overflow: hidden;
    animation: loginPop 0.2s ease;
}

.cmdk-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #eef0f4;
}

.cmdk-input-wrap i {
    color: var(--text-muted);
}

.cmdk-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.cmdk-esc {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--content-bg);
    border-radius: 4px;
    padding: 2px 6px;
}

.cmdk-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-dark);
}

.cmdk-item i {
    color: var(--primary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.cmdk-item.active {
    background: rgba(67, 97, 238, 0.08);
}

.cmdk-item .cmdk-enter {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
}

.cmdk-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══ LIVE BACKGROUND-SERVER STATUS (always visible) ═══ */
.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(46, 196, 182, 0.12);
    border: 1px solid rgba(46, 196, 182, 0.3);
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 rgba(46, 196, 182, 0.6);
    animation: liveDotPulse 1.6s infinite;
    flex-shrink: 0;
}

@keyframes liveDotPulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(46, 196, 182, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 196, 182, 0); }
}

.sidebar-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 4px;
}

/* ═══ HEADER USER / IP PILL ═══ */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--content-bg);
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    padding: 6px 14px 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: background 0.2s, box-shadow 0.2s;
}

.header-user-btn:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-ip-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.header-ip-pill i {
    font-size: 0.7rem;
}

/* ═══════════════════════════════════════
   LOGIN PAGE — modern gradient design
   ═══════════════════════════════════════ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 45%, #4361ee 100%);
    overflow: hidden;
    position: relative;
}

.login-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 20px;
    width: 100%;
    max-width: 440px;
    z-index: 2;
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    z-index: 1;
    pointer-events: none;
}

.login-blob-1 {
    width: 320px;
    height: 320px;
    background: var(--accent);
    top: -140px;
    left: -120px;
    animation: floatBlob 9s ease-in-out infinite;
}

.login-blob-2 {
    width: 280px;
    height: 280px;
    background: var(--success);
    bottom: -120px;
    right: -100px;
    animation: floatBlob 11s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.08); }
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    padding: 32px 32px 24px;
    animation: loginPop 0.5s ease;
}

@keyframes loginPop {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.login-title {
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.login-field .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

.login-field .input-group-text {
    background: var(--content-bg);
    border-right: none;
    color: var(--text-muted);
}

.login-field .form-control {
    border-left: none;
}

.login-field .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.login-field .input-group:focus-within .input-group-text {
    border-color: var(--primary);
}

.login-toggle-pass {
    cursor: pointer;
    background: var(--content-bg);
    border-left: none !important;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    font-weight: 700;
    padding: 10px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.35);
}

.login-ip-note {
    margin-top: 18px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--content-bg);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}

.login-ip-note strong {
    color: var(--text-dark);
}

.login-sq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warning), var(--accent));
    color: white;
    font-size: 1.6rem;
}

.login-cancel-link {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
}

.login-cancel-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.login-footer {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    text-align: center;
    z-index: 2;
}
