/*
 * Professional ERPNext UI Customizations
 * Modern, Clean, Corporate Design
 */

/* ============================================================
   CSS VARIABLES - Easy Theme Customization
   ============================================================ */
:root {
    /* Primary Brand Colors */
    --brand-primary: #2563eb;
    --brand-primary-dark: #1d4ed8;
    --brand-primary-light: #3b82f6;
    --brand-secondary: #0891b2;

    /* Accent Colors */
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;
    --accent-info: #0284c7;

    /* Neutral Colors */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* ============================================================
   NAVBAR - Professional Header
   ============================================================ */
.navbar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%) !important;
    box-shadow: var(--shadow-md);
    border-bottom: none !important;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
}

.navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition-fast);
}

.navbar .navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

/* Search Bar */
.navbar .search-bar {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
}

.navbar .search-bar:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar .search-bar input {
    color: #ffffff !important;
}

.navbar .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   SIDEBAR - Clean Navigation
   ============================================================ */
.frappe-control[data-page-container] .layout-side-section,
.desk-sidebar {
    background: var(--neutral-50);
    border-right: 1px solid var(--neutral-200);
}

.sidebar-menu .sidebar-label {
    font-weight: 600;
    color: var(--neutral-700);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 16px 8px;
}

.sidebar-menu a {
    color: var(--neutral-600);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin: 2px 8px;
    transition: var(--transition-fast);
}

.sidebar-menu a:hover {
    background: var(--neutral-200);
    color: var(--brand-primary);
}

.sidebar-menu a.active {
    background: var(--brand-primary);
    color: #ffffff;
}

/* ============================================================
   FORMS - Modern Input Styling
   ============================================================ */
.frappe-control input[type="text"],
.frappe-control input[type="password"],
.frappe-control input[type="email"],
.frappe-control input[type="number"],
.frappe-control textarea,
.frappe-control select {
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition-fast);
    background: #ffffff;
}

.frappe-control input:focus,
.frappe-control textarea:focus,
.frappe-control select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.frappe-control input:hover,
.frappe-control textarea:hover,
.frappe-control select:hover {
    border-color: var(--neutral-400);
}

/* Form Labels */
.frappe-control label,
.control-label {
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 13px;
    margin-bottom: 6px;
}

/* Required Field Indicator */
.frappe-control.has-error input,
.frappe-control.has-error select {
    border-color: var(--accent-danger);
}

.reqd .control-label::after {
    content: " *";
    color: var(--accent-danger);
}

/* ============================================================
   BUTTONS - Professional Styling
   ============================================================ */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary,
.btn-primary-dark {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary-dark:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--neutral-100);
    color: var(--neutral-700);
    border: 1px solid var(--neutral-300);
}

.btn-secondary:hover {
    background: var(--neutral-200);
    border-color: var(--neutral-400);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger) 0%, #b91c1c 100%);
}

/* Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.frappe-card,
.form-dashboard,
.widget {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
}

.frappe-card .card-header,
.form-dashboard .head {
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--neutral-800);
}

.frappe-card .card-body {
    padding: 20px;
}

/* ============================================================
   TABLES - Clean Data Display
   ============================================================ */
.frappe-list .list-row,
.datatable .dt-row {
    border-bottom: 1px solid var(--neutral-100);
    transition: var(--transition-fast);
}

.frappe-list .list-row:hover,
.datatable .dt-row:hover {
    background: var(--neutral-50);
}

.frappe-list .list-row-head {
    background: var(--neutral-100);
    font-weight: 600;
    color: var(--neutral-700);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Table Headers */
th, .dt-header {
    background: var(--neutral-50) !important;
    color: var(--neutral-600);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--neutral-200) !important;
}

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.indicator-pill {
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
}

.indicator-pill.green {
    background: rgba(5, 150, 105, 0.1);
    color: var(--accent-success);
}

.indicator-pill.red {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
}

.indicator-pill.orange {
    background: rgba(217, 119, 6, 0.1);
    color: var(--accent-warning);
}

.indicator-pill.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
}

.indicator-pill.gray {
    background: var(--neutral-100);
    color: var(--neutral-500);
}

/* ============================================================
   MODALS & DIALOGS
   ============================================================ */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 24px;
}

.modal-title {
    font-weight: 600;
    color: var(--neutral-800);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--neutral-200);
    padding: 16px 24px;
    background: var(--neutral-50);
}

/* ============================================================
   ALERTS & NOTIFICATIONS
   ============================================================ */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 14px 18px;
}

.alert-info {
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent-info);
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--accent-success);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--accent-warning);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
}

/* Toast Notifications */
.toast {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-head {
    background: #ffffff;
    border-bottom: 1px solid var(--neutral-200);
    padding: 16px 24px;
}

.page-head .page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--neutral-900);
}

.page-head .page-subtitle {
    color: var(--neutral-500);
    font-size: 14px;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--neutral-500);
}

.breadcrumb-item.active {
    color: var(--neutral-700);
}

/* ============================================================
   DASHBOARD WIDGETS
   ============================================================ */
.number-widget {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
}

.number-widget .number {
    font-size: 36px;
    font-weight: 700;
}

.number-widget .label {
    opacity: 0.9;
    font-size: 14px;
}

/* Chart Widgets */
.chart-widget {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-item {
    padding-left: 30px;
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--brand-primary);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 4px;
}

.timeline-item::after {
    content: "";
    width: 2px;
    height: calc(100% + 20px);
    background: var(--neutral-200);
    position: absolute;
    left: 5px;
    top: 16px;
}

.timeline-item:last-child::after {
    display: none;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .navbar,
    .page-head,
    .sidebar,
    .btn {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .print-format {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .print-format table {
        width: 100%;
        border-collapse: collapse;
    }

    .print-format th,
    .print-format td {
        border: 1px solid var(--neutral-300);
        padding: 10px;
        text-align: left;
    }

    .print-format th {
        background: var(--neutral-100);
        font-weight: 600;
    }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .page-head .page-title {
        font-size: 20px;
    }

    .btn {
        padding: 10px 14px;
    }

    .modal-content {
        margin: 10px;
        border-radius: var(--radius-lg);
    }
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.loading-skeleton {
    background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

/* ============================================================
   FRAPPE SPECIFIC OVERRIDES
   ============================================================ */
.page-container {
    background: var(--neutral-50);
}

.main-section {
    background: #ffffff;
    border-radius: var(--radius-lg);
    margin: 16px;
    box-shadow: var(--shadow-sm);
}

/* Form Section Headers */
.section-head {
    background: var(--neutral-50);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--neutral-700);
    border-bottom: 1px solid var(--neutral-200);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Currency Fields - Right Align */
.frappe-control[data-fieldtype="Currency"] input,
.frappe-control[data-fieldtype="Float"] input,
.frappe-control[data-fieldtype="Int"] input {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Link Fields */
.frappe-control[data-fieldtype="Link"] .link-btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Awesomplete Dropdown */
.awesomplete > ul {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--neutral-200);
}

.awesomplete > ul > li:hover {
    background: var(--neutral-100);
}

.awesomplete > ul > li[aria-selected="true"] {
    background: var(--brand-primary);
    color: #ffffff;
}

/* ============================================================
   ENTERPRISE DASHBOARD SYSTEM
   ============================================================ */

/* Dashboard Container */
.enterprise-dashboard {
    padding: 24px;
    background: var(--neutral-50);
    min-height: calc(100vh - 60px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--neutral-500);
    margin-top: 4px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--brand-primary);
}

.kpi-card.success::before { background: var(--accent-success); }
.kpi-card.warning::before { background: var(--accent-warning); }
.kpi-card.danger::before { background: var(--accent-danger); }
.kpi-card.info::before { background: var(--accent-info); }

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.kpi-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
}

.kpi-card.success .kpi-card-icon { background: rgba(5, 150, 105, 0.1); color: var(--accent-success); }
.kpi-card.warning .kpi-card-icon { background: rgba(217, 119, 6, 0.1); color: var(--accent-warning); }
.kpi-card.danger .kpi-card-icon { background: rgba(220, 38, 38, 0.1); color: var(--accent-danger); }
.kpi-card.info .kpi-card-icon { background: rgba(2, 132, 199, 0.1); color: var(--accent-info); }

.kpi-card-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.kpi-card-trend.up {
    background: rgba(5, 150, 105, 0.1);
    color: var(--accent-success);
}

.kpi-card-trend.down {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
}

.kpi-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: 4px;
}

.kpi-card-label {
    font-size: 14px;
    color: var(--neutral-500);
    font-weight: 500;
}

.kpi-card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-100);
    font-size: 13px;
    color: var(--neutral-500);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
}

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

.chart-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-800);
    margin: 0;
}

.chart-card-actions {
    display: flex;
    gap: 8px;
}

.chart-card-actions .btn {
    padding: 4px 12px;
    font-size: 12px;
}

/* Quick Actions Panel */
.quick-actions {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    margin-bottom: 24px;
}

.quick-actions-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: 16px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: var(--neutral-700);
}

.quick-action-btn:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    transition: var(--transition-fast);
}

.status-card:hover {
    box-shadow: var(--shadow-md);
}

.status-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.status-card-icon.draft { background: rgba(100, 116, 139, 0.1); color: var(--neutral-500); }
.status-card-icon.pending { background: rgba(217, 119, 6, 0.1); color: var(--accent-warning); }
.status-card-icon.completed { background: rgba(5, 150, 105, 0.1); color: var(--accent-success); }
.status-card-icon.overdue { background: rgba(220, 38, 38, 0.1); color: var(--accent-danger); }

.status-card-content {
    flex: 1;
}

.status-card-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--neutral-900);
}

.status-card-label {
    font-size: 13px;
    color: var(--neutral-500);
}

/* Activity Timeline */
.activity-panel {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
}

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

.activity-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-800);
    margin: 0;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-item-icon.invoice { background: rgba(37, 99, 235, 0.1); color: var(--brand-primary); }
.activity-item-icon.payment { background: rgba(5, 150, 105, 0.1); color: var(--accent-success); }
.activity-item-icon.order { background: rgba(217, 119, 6, 0.1); color: var(--accent-warning); }
.activity-item-icon.alert { background: rgba(220, 38, 38, 0.1); color: var(--accent-danger); }

.activity-item-content {
    flex: 1;
}

.activity-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-800);
    margin-bottom: 4px;
}

.activity-item-desc {
    font-size: 13px;
    color: var(--neutral-500);
}

.activity-item-time {
    font-size: 12px;
    color: var(--neutral-400);
    white-space: nowrap;
}

/* Data Tables in Dashboard */
.dashboard-table {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    margin-bottom: 24px;
}

.dashboard-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.dashboard-table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-800);
    margin: 0;
}

.dashboard-table table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.dashboard-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--neutral-700);
    border-bottom: 1px solid var(--neutral-100);
}

.dashboard-table tr:hover td {
    background: var(--neutral-50);
}

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

/* ============================================================
   NOTIFICATION CENTER
   ============================================================ */

.notification-center {
    position: fixed;
    top: 60px;
    right: 0;
    width: 380px;
    height: calc(100vh - 60px);
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.notification-center.open {
    transform: translateX(0);
}

.notification-center-header {
    padding: 20px;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-center-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0;
}

.notification-center-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--neutral-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.notification-center-close:hover {
    background: var(--neutral-200);
}

.notification-tabs {
    display: flex;
    border-bottom: 1px solid var(--neutral-200);
}

.notification-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.notification-tab:hover {
    color: var(--neutral-700);
}

.notification-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.notification-tab .badge {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: var(--accent-danger);
    color: #ffffff;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--neutral-100);
    cursor: pointer;
    transition: var(--transition-fast);
}

.notification-item:hover {
    background: var(--neutral-50);
}

.notification-item.unread {
    background: rgba(37, 99, 235, 0.05);
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.notification-item-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}

.notification-item-type.alert { background: rgba(220, 38, 38, 0.1); color: var(--accent-danger); }
.notification-item-type.info { background: rgba(2, 132, 199, 0.1); color: var(--accent-info); }
.notification-item-type.success { background: rgba(5, 150, 105, 0.1); color: var(--accent-success); }
.notification-item-type.warning { background: rgba(217, 119, 6, 0.1); color: var(--accent-warning); }

.notification-item-time {
    font-size: 12px;
    color: var(--neutral-400);
}

.notification-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-800);
    margin-bottom: 4px;
}

.notification-item-desc {
    font-size: 13px;
    color: var(--neutral-500);
    line-height: 1.4;
}

/* ============================================================
   MODULE-SPECIFIC STYLES
   ============================================================ */

/* Accounting Module */
.accounting-dashboard .kpi-card.revenue::before { background: var(--accent-success); }
.accounting-dashboard .kpi-card.expense::before { background: var(--accent-danger); }
.accounting-dashboard .kpi-card.receivable::before { background: var(--accent-warning); }
.accounting-dashboard .kpi-card.payable::before { background: var(--accent-info); }

/* Sales Module */
.sales-dashboard .pipeline-chart {
    height: 300px;
}

.sales-dashboard .top-customers {
    margin-top: 20px;
}

/* HR Module */
.hr-dashboard .employee-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hr-dashboard .attendance-chart {
    height: 250px;
}

/* Stock Module */
.stock-dashboard .stock-level-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stock-dashboard .stock-level-bar {
    flex: 1;
    height: 8px;
    background: var(--neutral-200);
    border-radius: 4px;
    overflow: hidden;
}

.stock-dashboard .stock-level-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stock-dashboard .stock-level-fill.high { background: var(--accent-success); }
.stock-dashboard .stock-level-fill.medium { background: var(--accent-warning); }
.stock-dashboard .stock-level-fill.low { background: var(--accent-danger); }

/* ============================================================
   WORKSPACE ENHANCEMENTS
   ============================================================ */

.workspace-page {
    background: var(--neutral-50);
}

.workspace-page .widget-group {
    margin-bottom: 24px;
}

.workspace-page .widget-group-head {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--neutral-200);
}

/* Number Card Widgets */
.number-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: var(--transition-normal);
}

.number-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.number-card .widget-head {
    font-size: 13px;
    color: var(--neutral-500);
    font-weight: 500;
    margin-bottom: 8px;
}

.number-card .widget-body {
    font-size: 28px;
    font-weight: 700;
    color: var(--neutral-900);
}

.number-card .widget-footer {
    margin-top: 12px;
    font-size: 12px;
    color: var(--neutral-400);
}

/* Shortcut Widgets */
.shortcut-widget-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    transition: var(--transition-fast);
}

.shortcut-widget-box:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

.shortcut-widget-box:hover .widget-head {
    color: #ffffff;
}

.shortcut-widget-box .widget-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--brand-primary);
}

.shortcut-widget-box:hover .widget-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ============================================================
   GLOBAL NAVBAR NOTIFICATION BADGE
   ============================================================ */

.navbar .notification-badge {
    position: relative;
}

.navbar .notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar .notification-badge[data-count="0"]::after {
    display: none;
}

/* ============================================================
   ROLE-BASED UI THEMES
   ============================================================ */

/* Accountant Theme */
body.role-accountant .navbar {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

body.role-accountant .sidebar-menu a.active {
    background: #059669;
}

/* Sales Theme */
body.role-sales .navbar {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* HR Theme */
body.role-hr .navbar {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

body.role-hr .sidebar-menu a.active {
    background: #7c3aed;
}

/* Stock Theme */
body.role-stock .navbar {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
}

body.role-stock .sidebar-menu a.active {
    background: #0891b2;
}

/* ============================================================
   RESPONSIVE DASHBOARD
   ============================================================ */

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

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

@media (max-width: 768px) {
    .enterprise-dashboard {
        padding: 16px;
    }

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

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .notification-center {
        width: 100%;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   DARK MODE SUPPORT (if enabled)
   ============================================================ */

@media (prefers-color-scheme: dark) {
    body.dark-mode {
        --neutral-50: #1e293b;
        --neutral-100: #334155;
        --neutral-200: #475569;
        --neutral-700: #e2e8f0;
        --neutral-800: #f1f5f9;
        --neutral-900: #f8fafc;
    }

    body.dark-mode .kpi-card,
    body.dark-mode .chart-card,
    body.dark-mode .quick-actions,
    body.dark-mode .activity-panel,
    body.dark-mode .dashboard-table,
    body.dark-mode .notification-center {
        background: var(--neutral-100);
    }
}

/* ============================================================
   CLAUDE AI CHAT AGENT
   ============================================================ */

.claude-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.claude-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.claude-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(217, 119, 6, 0.5);
}

.claude-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

.claude-chat-toggle .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(217, 119, 6, 0.4);
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.claude-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.claude-chat-window.open {
    display: flex;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.claude-chat-header {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.claude-chat-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.claude-chat-header-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

.claude-chat-header-info {
    flex: 1;
}

.claude-chat-header-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.claude-chat-header-status {
    font-size: 12px;
    opacity: 0.9;
}

.claude-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.claude-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.claude-chat-close svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

.claude-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9fafb;
}

.claude-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.claude-message.assistant {
    background: #ffffff;
    color: #374151;
    align-self: flex-start;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.claude-message.user {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.claude-message.typing {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.claude-message.typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-dot 1.4s infinite ease-in-out;
}

.claude-message.typing span:nth-child(2) { animation-delay: 0.2s; }
.claude-message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.claude-chat-input-area {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.claude-chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.claude-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.claude-chat-input:focus {
    border-color: #d97706;
}

.claude-chat-input::placeholder {
    color: #9ca3af;
}

.claude-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.claude-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.claude-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.claude-chat-send svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.claude-chat-context {
    padding: 8px 16px;
    background: #fef3c7;
    border-top: 1px solid #fcd34d;
    font-size: 12px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.claude-chat-context i {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .claude-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 76px;
        right: -8px;
    }

    .claude-chat-widget {
        bottom: 16px;
        right: 16px;
    }
}
