/* =========================================================
   AspirenCRM — Elegant Dark Glass-Panel Design System
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    /* Backgrounds */
    --bg-base: #09090b;
    --bg-raised: rgba(255, 255, 255, 0.03);
    --bg-surface: rgba(255, 255, 255, 0.05);
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.07);
    --bg-hover: rgba(255, 255, 255, 0.04);

    /* Borders — full or none, never one-sided */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(16, 185, 129, 0.5);

    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --text-inverse: #09090b;

    /* Accent */
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-subtle: rgba(16, 185, 129, 0.1);
    --accent-glow: rgba(16, 185, 129, 0.15);

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.1);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Sidebar */
    --sidebar-width: 260px;

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================================
   Layout Shell
   ========================================================= */

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

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 101;
    transition: transform var(--transition-smooth);
}

.sidebar-logo {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    height: 64px;
}

.sidebar-logo .logo-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo .logo-text .logo-accent {
    color: var(--accent);
    font-weight: 500;
}

.sidebar-logo .logo-mark {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent), #059669);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 13px;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
    align-items: center;
    justify-content: center;
}

.sidebar-close-btn:hover {
    background-color: var(--bg-hover);
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.menu-item a, .menu-item button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13.5px;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    min-height: 44px;
}

.menu-item a:hover, .menu-item button:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.menu-item.active a {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

.menu-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.menu-item.active .nav-icon {
    opacity: 1;
}

.menu-item a:hover .nav-icon {
    opacity: 1;
}

/* Sidebar User Section */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-user .user-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-meta-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-meta-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
}

/* --- Main Wrapper --- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Topbar --- */
.topbar {
    height: 64px;
    background-color: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background-color: var(--bg-hover);
}

.hamburger-btn svg {
    width: 20px;
    height: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-profile-role {
    font-size: 11px;
    color: var(--text-muted);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    border: none;
}

/* =========================================================
   Page Container
   ========================================================= */

.page-container {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =========================================================
   Panels (Glass Cards)
   ========================================================= */

.panel {
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition-fast);
}

.panel:hover {
    border-color: var(--border-medium);
}

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

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* =========================================================
   Stat Cards (Dashboard)
   ========================================================= */

.stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    margin-top: 4px;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    flex-shrink: 0;
}

.stat-icon.emerald { background: var(--color-success-bg); color: var(--color-success); }
.stat-icon.blue { background: var(--color-info-bg); color: var(--color-info); }
.stat-icon.amber { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-icon.violet { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.stat-icon svg {
    width: 22px;
    height: 22px;
}

/* =========================================================
   Tables
   ========================================================= */

.crm-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.crm-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
}

.crm-table td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.crm-table tbody tr {
    transition: background-color var(--transition-fast);
}

.crm-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.crm-table tbody tr:last-child td {
    border-bottom: none;
}

.td-name {
    font-weight: 600;
    color: var(--text-primary) !important;
}

.td-link {
    color: var(--accent) !important;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.td-link:hover {
    color: var(--accent-hover) !important;
}

.td-muted {
    color: var(--text-muted) !important;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn-add {
    background-color: var(--accent);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-add:hover {
    background-color: var(--accent-hover);
    transform: scale(0.97);
}

.btn-add:active {
    transform: scale(0.94);
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.btn-action:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.btn-action.edit:hover {
    color: var(--accent);
    background-color: var(--accent-subtle);
}

.btn-action.delete:hover {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

.btn-submit {
    padding: 10px 24px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.btn-submit:active {
    transform: scale(0.97);
}

.btn-cancel {
    padding: 10px 24px;
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    border-radius: var(--radius-sm) !important;
}

/* Stage Action Button */
.btn-stage-action {
    padding: 6px 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-stage-action:hover {
    background-color: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================================
   Modals
   ========================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

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

.modal-content {
    background: #18181b;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-modal);
    animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

/* =========================================================
   Forms
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-full {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-input);
    outline: none;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.form-input:focus {
    border-color: var(--border-focus);
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2352525b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 36px;
}

select.form-input option {
    background-color: #18181b;
    color: var(--text-primary);
}

/* =========================================================
   Badges
   ========================================================= */

.stage-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.badge-blue {
    background-color: var(--color-info-bg);
    color: #60a5fa;
}
.badge-blue .badge-dot { background-color: #60a5fa; }

.badge-green {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}
.badge-green .badge-dot { background-color: var(--color-success); }

.badge-yellow {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}
.badge-yellow .badge-dot { background-color: var(--color-warning); }

.badge-gray {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
}
.badge-gray .badge-dot { background-color: var(--text-muted); }

.badge-red {
    background-color: var(--color-danger-bg);
    color: #f87171;
}
.badge-red .badge-dot { background-color: #f87171; }

/* =========================================================
   Stage Movement (Leads Pipeline)
   ========================================================= */

.stage-movement-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 24px;
}

.stage-movement-panel {
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stage-header-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 28px;
    padding: 0 8px;
}

.stage-header-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--border-subtle), var(--accent), var(--border-subtle));
    z-index: 1;
    opacity: 0.4;
}

.stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-smooth);
}

.stage-step.active .step-number {
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.stage-step.success .step-number {
    background-color: var(--color-success);
    color: white;
    border-color: transparent;
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.stage-step.active .step-label {
    color: var(--accent);
    font-weight: 600;
}

/* Guide Panel */
.guide-panel {
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.guide-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--accent);
    flex-shrink: 0;
    margin-top: 6px;
}

/* =========================================================
   Progress Bars (Dashboard / Reports)
   ========================================================= */

.progress-track {
    height: 6px;
    background-color: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent), #34d399);
    transition: width var(--transition-smooth);
}

.progress-fill.blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-fill.amber {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-fill.red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-fill.violet {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.progress-fill.gray {
    background: linear-gradient(90deg, #52525b, #71717a);
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.progress-label-row .label-text {
    color: var(--text-secondary);
}

.progress-label-row .label-count {
    color: var(--text-primary);
    font-weight: 700;
}

/* =========================================================
   Login Page
   ========================================================= */

.login-body {
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
}

.login-container {
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-modal);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
}

.login-logo-mark {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #059669);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
}

.login-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.login-logo-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.login-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.login-form-group {
    text-align: left;
    margin-bottom: 18px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
    transition: all var(--transition-fast);
    min-height: 44px;
    font-family: inherit;
}

.login-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0) scale(0.98);
}

.login-footer {
    margin-top: 36px;
    font-size: 12px;
    color: var(--text-muted);
}

.login-remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.login-remember-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.login-remember-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.login-remember-row a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.login-remember-row a:hover {
    color: var(--accent-hover);
}

/* =========================================================
   Alerts
   ========================================================= */

.alert-error, .alert-success {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background-color: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.alert-success {
    background-color: var(--color-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* =========================================================
   Pagination
   ========================================================= */

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination a:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.pagination .active span,
.pagination span[aria-current="page"] {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* =========================================================
   Dashboard Grid
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* =========================================================
   Settings Page
   ========================================================= */

.settings-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

/* =========================================================
   Employee Avatar in table
   ========================================================= */

.employee-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-name-cell .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 11px;
    flex-shrink: 0;
}

/* =========================================================
   View All link
   ========================================================= */

.link-view-all {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.link-view-all:hover {
    color: var(--accent-hover);
}

/* =========================================================
   Utility Classes
   ========================================================= */

.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-20 { gap: 20px; }

/* =========================================================
   Responsive — Tablet (1024px)
   ========================================================= */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stage-movement-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Filter Bar
   ========================================================= */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 150px;
}

.filter-group.search {
    flex: 2;
    min-width: 200px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-input);
    outline: none;
    transition: all var(--transition-fast);
    height: 40px;
}

.filter-input:focus {
    border-color: var(--border-focus);
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

select.filter-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2352525b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 14px;
    padding-right: 32px;
    cursor: pointer;
}

select.filter-input option {
    background-color: #18181b;
    color: var(--text-primary);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.btn-filter {
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-filter-apply {
    background-color: var(--accent);
    color: white;
    border: none;
}

.btn-filter-apply:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.btn-filter-apply:active {
    transform: scale(0.97);
}

.btn-filter-clear {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-filter-clear:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-filter svg {
    width: 15px;
    height: 15px;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background-color: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.filter-tag a {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.filter-tag a:hover {
    opacity: 1;
}

/* =========================================================
   Responsive — Mobile (768px)
   ========================================================= */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-container {
        padding: 16px;
        gap: 16px;
    }

    .panel {
        padding: 18px;
    }

    .stage-movement-panel {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: span 1;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

    .stage-header-steps {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }

    .stage-header-steps::before {
        display: none;
    }

    .stage-step {
        flex: 0 0 auto;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .modal-content {
        padding: 20px;
        margin: 12px;
    }
}

/* =========================================================
   Responsive — Small Mobile (480px)
   ========================================================= */

@media (max-width: 480px) {
    .topbar-title {
        font-size: 15px;
    }

    .user-info {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stage-step {
        flex: 1 1 25%;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .page-container {
        padding: 12px;
    }
}
