/* Modern Professional Theme - SaaS refresh */
:root {
    --bg: #f4f7fb;
    --bg-accent: #eef4ff;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef3f8;
    --border: rgba(148, 163, 184, 0.24);
    --border-strong: rgba(100, 116, 139, 0.24);
    --text: #10233f;
    --muted: #6b7a90;
    --heading: #081427;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #0f9f6e;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --shadow-sm: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 22px 60px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.16);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 55%, #edf2f8 100%);
    color: var(--text);
    min-height: 100vh;
}

body.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 96px;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 800;
    letter-spacing: -0.025em;
}

p, label, .text-muted, small {
    color: var(--muted) !important;
}

.page-container {
    flex: 1;
    padding-bottom: 2rem;
}

.app-main-content {
    position: relative;
    z-index: 1;
}

.container,
.container-fluid {
    position: relative;
}

/* Header and navbar */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
}

.app-navbar {
    min-height: 84px;
    background: rgba(9, 18, 34, 0.82) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 45px rgba(2, 8, 23, 0.22);
}

.app-navbar-inner {
    gap: 1rem;
}

.app-navbar-toggler {
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: none !important;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.app-brand:hover {
    text-decoration: none;
}

.app-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.app-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.app-brand-title {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1rem;
}

.app-brand-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-main-nav {
    gap: 0.2rem;
}

.app-main-nav .nav-link,
.app-user-nav .nav-link {
    color: rgba(255, 255, 255, 0.84) !important;
    font-weight: 700;
    font-size: 0.93rem;
    border-radius: 999px;
    padding: 0.64rem 0.92rem !important;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.app-main-nav .nav-link i {
    font-size: 0.92rem;
    opacity: 0.9;
}

.app-main-nav .nav-link:hover,
.app-main-nav .nav-link:focus,
.app-main-nav .show > .nav-link,
.app-main-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.10);
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-user-nav {
    gap: 0.65rem;
}

.app-icon-link {
    padding: 0 !important;
    background: transparent !important;
}

.app-icon-shell {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.app-icon-link:hover .app-icon-shell,
.app-icon-link:focus .app-icon-shell {
    background: rgba(255, 255, 255, 0.14);
}

.app-notification-nav {
    position: relative;
}

.app-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(9, 18, 34, 0.9);
}

.app-user-trigger {
    padding: 0.28rem 0.4rem 0.28rem 0.32rem !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    gap: 0.7rem !important;
}

.app-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #334155);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

.app-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-align: left;
}

.app-user-name {
    color: #fff;
    font-size: 0.88rem;
}

.app-user-email {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    font-weight: 500;
}

.app-dropdown {
    margin-top: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    padding: 0.5rem;
    min-width: 235px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
    z-index: 3200;
}

.app-dropdown-label {
    padding: 0.55rem 0.75rem 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
}

.app-dropdown .dropdown-item {
    border-radius: 12px;
    font-weight: 700;
    padding: 0.72rem 0.85rem;
    color: var(--text);
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus {
    background: #f8fafc;
}

.app-notification-menu {
    width: 320px;
}

.app-notification-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 0.35rem;
    background: #f8fbff;
}

.app-notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}

.app-notification-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.app-notification-icon.info { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.app-notification-icon.success { background: linear-gradient(135deg, #10b981, #059669); }

/* Alerts */
.alert {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
}

/* Shared cards */
.card {
    border: 1px solid rgba(219, 227, 238, 0.85);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.card-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1rem 1.25rem;
    font-weight: 800;
}

.card-body {
    padding: 1.25rem;
}

.bg-primary,
.bg-success,
.bg-warning,
.bg-danger,
.bg-info,
.bg-secondary {
    position: relative;
    overflow: hidden;
}

.bg-primary::before,
.bg-success::before,
.bg-warning::before,
.bg-danger::before,
.bg-info::before,
.bg-secondary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
    pointer-events: none;
}

.bg-primary { background: linear-gradient(135deg, #2563eb, #1e40af) !important; }
.bg-success { background: linear-gradient(135deg, #0f9f6e, #0f766e) !important; }
.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.bg-danger { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
.bg-info { background: linear-gradient(135deg, #06b6d4, #0f766e) !important; }
.bg-secondary { background: linear-gradient(135deg, #64748b, #334155) !important; }

/* Dashboard */
.dashboard-hero {
    margin-top: 0.5rem;
}

.dashboard-hero__content {
    border-radius: 28px;
    padding: 1.8rem 1.9rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(29, 78, 216, 0.86));
    color: #fff;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.24);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dashboard-hero__content::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -110px;
    top: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 66%);
}

.dashboard-eyebrow {
    display: inline-flex;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255,255,255,0.86);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.9rem;
}

.dashboard-title {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 2.15rem;
}

.dashboard-subtitle {
    max-width: 700px;
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 1rem;
}

.dashboard-hero__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.hero-stat-card {
    min-width: 250px;
    padding: 1rem 1.15rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.hero-stat-value {
    color: #fff;
    font-size: 1.6rem;
    line-height: 1.1;
}

.hero-action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-stats-row .col-xl-3,
.dashboard-stats-row .col-md-6 {
    display: flex;
}

.metric-card {
    width: 100%;
    border-radius: 22px;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    right: -48px;
    top: -48px;
    background: rgba(255,255,255,0.10);
}

.metric-card--primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.metric-card--warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.metric-card--danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.metric-card--success { background: linear-gradient(135deg, #10b981, #0f766e); }

.metric-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255,255,255,0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.metric-card__body {
    position: relative;
    z-index: 1;
}

.metric-card__label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.78);
    margin-bottom: 0.35rem;
    font-weight: 800;
}

.metric-card__value {
    color: #fff;
    font-size: 1.9rem;
    margin-bottom: 0.3rem;
}

.metric-card__meta {
    color: rgba(255,255,255,0.76) !important;
    font-size: 0.88rem;
}

.dashboard-panel {
    border-radius: 24px;
}

.dashboard-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-kicker {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.modern-table-wrap {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    overflow: hidden;
}

.modern-table thead th {
    background: #f8fbff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    color: #64748b;
    padding: 0.95rem 0.9rem;
}

.modern-table tbody td {
    padding: 0.95rem 0.9rem;
    border-top: 1px solid rgba(241, 245, 249, 0.95);
    vertical-align: middle;
}

.modern-badge {
    border-radius: 999px;
    font-weight: 800;
    padding: 0.48rem 0.7rem;
    letter-spacing: 0.02em;
}

.customer-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(241, 245, 249, 0.92);
}

.customer-highlight:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.customer-highlight__name {
    font-weight: 800;
    color: var(--heading);
}

.customer-highlight__meta {
    font-size: 0.84rem;
    color: var(--muted);
}

.quick-action-grid {
    display: grid;
    gap: 0.9rem;
}

.quick-action-tile {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.quick-action-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.quick-action-tile__icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.10);
    color: var(--primary);
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.quick-action-tile strong {
    display: block;
    color: var(--heading);
}

.quick-action-tile small {
    display: block;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.timeline-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.timeline-item__marker {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.10);
    color: var(--primary);
    flex: 0 0 auto;
}

.timeline-item__content {
    padding-top: 0.15rem;
}

/* Buttons */
.btn {
    border-radius: 14px;
    font-weight: 800;
    padding: 0.7rem 1rem;
    border-width: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
    filter: saturate(1.03);
}

.btn:focus,
.btn.focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18), 0 14px 24px rgba(15, 23, 42, 0.12);
}

.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.btn-info { background: linear-gradient(135deg, #0891b2, #0e7490); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-secondary { background: linear-gradient(135deg, #64748b, #475569); }
.btn-light {
    background: #fff;
    color: var(--text);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.btn-sm,
.btn-group-sm > .btn {
    border-radius: 12px;
    padding: 0.45rem 0.78rem;
    font-size: 0.84rem;
}

/* Forms */
label {
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.form-control,
.custom-select,
textarea.form-control {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.95);
    min-height: 46px;
    padding: 0.72rem 0.9rem;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.form-control:focus,
.custom-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.14);
}

.input-group-text {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
}

/* Tables */
.table-responsive {
    border-radius: 16px;
}

.table {
    color: var(--text);
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td,
.table th {
    vertical-align: middle;
}

/* Footer */
.footer {
    background: transparent !important;
    border-top: 1px solid rgba(219, 227, 238, 0.75);
}

/* Keep dropdowns above cards */
.navbar,
.app-header,
.app-dropdown,
.dropdown-menu {
    z-index: 3000 !important;
}

.card,
.table-responsive,
.dashboard-card,
.stat-card,
.metric-card,
.dashboard-panel {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 1199.98px) {
    body.app-shell {
        padding-top: 88px;
    }

    .app-navbar .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 22px;
        background: rgba(9, 18, 34, 0.95);
        box-shadow: var(--shadow-md);
    }

    .app-main-nav {
        gap: 0.25rem;
        margin-bottom: 1rem;
    }

    .app-main-nav .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .app-user-nav {
        justify-content: space-between;
    }

    .dashboard-hero__content,
    .dashboard-hero__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-action-stack {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    body.app-shell {
        padding-top: 84px;
    }

    .app-brand-subtitle,
    .app-user-meta {
        display: none !important;
    }

    .dashboard-title {
        font-size: 1.7rem;
    }

    .dashboard-hero__content {
        padding: 1.4rem;
    }

    .hero-stat-card {
        width: 100%;
        min-width: 0;
    }

    .hero-action-stack {
        width: 100%;
        flex-direction: column;
    }

    .app-notification-menu {
        width: 280px;
    }
}


.card details summary { cursor: pointer; font-weight: 600; }
.card pre { white-space: pre-wrap; word-break: break-word; }
#add-company-card { scroll-margin-top: 110px; }


/* SRD Productions brand refresh */
:root {
    --srd-yellow: #f2c300;
    --srd-yellow-deep: #d9ad00;
    --srd-black: #0b0b0c;
    --srd-graphite: #1c1c1f;
    --srd-soft: #f3f4f6;
    --srd-ink: #121317;
}
body.srd-theme {
    background:
        radial-gradient(circle at top left, rgba(242, 195, 0, 0.14), transparent 26%),
        linear-gradient(180deg, #fbfbfc 0%, #f2f3f5 100%);
    color: var(--srd-ink);
}
.app-main-width { max-width: 1680px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.app-navbar {
    background: linear-gradient(135deg, rgba(8,8,9,.97), rgba(24,24,27,.96)) !important;
    border-bottom: 1px solid rgba(242,195,0,.25);
    box-shadow: 0 20px 45px rgba(0,0,0,.30);
}
.app-brand {
    gap: .8rem;
    align-items: center;
}
 .app-brand-logo {
    width: 112px;
    height: 40px;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
    flex: 0 0 auto;
}
.app-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center left;
    filter: none;
}
.app-brand-mark { display:none !important; }
.app-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.app-brand-title {
    color: var(--srd-yellow);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.app-brand-subtitle {
    color: rgba(255,255,255,.72);
    font-size: .73rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.app-main-nav .nav-link:hover,
.app-main-nav .nav-link:focus,
.app-main-nav .show > .nav-link,
.app-main-nav .nav-link.active {
    color: var(--srd-yellow) !important;
    background: rgba(242,195,0,.10);
    box-shadow: inset 0 0 0 1px rgba(242,195,0,.16);
}
.app-icon-shell,
.app-user-trigger,
.app-dropdown,
.card,
.metric-card,
.dashboard-panel,
.quick-action-tile,
.hero-stat-card,
.customer-highlight,
.portal-card,
.portal-summary-card,
.srd-card,
.login-card,
.setup-card {
    box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
}
.app-dropdown { border-color: rgba(242,195,0,.18); }
.btn-primary,
.badge-primary,
.metric-card--primary .metric-card__icon,
.quick-action-tile__icon,
.portal-badge,
.srd-chip {
    background: linear-gradient(135deg, var(--srd-yellow), var(--srd-yellow-deep)) !important;
    color: #111 !important;
    border-color: rgba(0,0,0,.06) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #ffd742, var(--srd-yellow)) !important;
    color: #111 !important;
}
.btn-outline-primary, .text-primary { color: #151515 !important; border-color: rgba(242,195,0,.55) !important; }
.btn-outline-primary:hover { background: rgba(242,195,0,.12) !important; color: #151515 !important; }
.dashboard-hero {
    position: relative; overflow: hidden; border-radius: 28px; padding: 2rem 2.2rem;
    background: linear-gradient(135deg, #080808 0%, #151515 55%, #1f1f21 100%);
    color: #fff;
}
.dashboard-hero:after {
    content: ''; position: absolute; inset: auto -5% -40% auto; width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242,195,0,.28), rgba(242,195,0,0) 70%);
}
.dashboard-eyebrow, .section-kicker { color: rgba(242,195,0,.85) !important; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.dashboard-title, .dashboard-hero h1 { color: #fff !important; }
.dashboard-subtitle { color: rgba(255,255,255,.72) !important; max-width: 720px; }
.hero-stat-card {
    background: rgba(255,255,255,.08); border: 1px solid rgba(242,195,0,.16); border-radius: 20px; padding: 1rem 1.1rem;
}
.hero-stat-label { display:block; color: rgba(255,255,255,.70); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.hero-stat-value { color: var(--srd-yellow); font-size: 1.65rem; }
.metric-card {
    border: 1px solid rgba(242,195,0,.16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,249,250,.98));
    min-height: 100%;
}
.metric-card__body { min-width: 0; }
.metric-card__label { color: #5b6472 !important; }
.metric-card__value { color: #121317 !important; line-height: 1.12; }
.metric-card__meta { color: #6b7280 !important; }
.metric-card__icon {
    width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items:center; justify-content:center;
    background: rgba(242,195,0,.16); color:#111;
}
.metric-card--warning .metric-card__icon { background: rgba(245,158,11,.16); color:#9a6500; }
.metric-card--danger .metric-card__icon { background: rgba(220,38,38,.12); color:#b91c1c; }
.metric-card--success .metric-card__icon { background: rgba(34,197,94,.14); color:#15803d; }
.dashboard-panel { border:1px solid rgba(15,23,42,.06); border-radius: 24px; overflow:hidden; }
.dashboard-panel__header { background: linear-gradient(180deg, #fff, #fafaf8); border-bottom: 1px solid rgba(242,195,0,.16); }
.quick-action-tile { border:1px solid rgba(242,195,0,.14); background: #fff; border-radius: 18px; }
.quick-action-tile:hover { transform: translateY(-2px); border-color: rgba(242,195,0,.35); }
.customer-highlight { border:1px solid rgba(242,195,0,.10); border-radius: 18px; padding: .95rem 1rem; background:#fff; }

/* Login */
.login-shell {
    min-height: calc(100vh - 96px); display:flex; align-items:center; justify-content:center; padding: 2.4rem 0;
}
.login-split { display:grid; grid-template-columns: 1.1fr .9fr; gap: 1.4rem; width: 100%; max-width: 1260px; }
.login-hero, .login-card { border-radius: 28px; overflow:hidden; }
.login-hero {
    position: relative; padding: 2.6rem; background: linear-gradient(135deg, #080808 0%, #171717 55%, #1f1f1f 100%); color:#fff;
}
.login-hero:before {
    content:''; position:absolute; right:-10%; top:-16%; width:360px; height:360px; border-radius:50%; background: radial-gradient(circle, rgba(242,195,0,.22), rgba(242,195,0,0) 72%);
}
.login-hero .brand-badge { display:inline-flex; align-items:center; gap:.75rem; margin-bottom:1.6rem; }
.login-hero .brand-badge img { width: 240px; max-width: 100%; height: 96px; border-radius: 18px; object-fit: contain; object-position: center; background: #fff; padding: 0.35rem 0.6rem; box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.login-hero h1 { color:#fff; font-size:2.35rem; margin-bottom: .9rem; }
.login-hero p, .login-hero li { color: rgba(255,255,255,.76) !important; }
.login-card { background:#fff; border:1px solid rgba(242,195,0,.18); }
.login-card .card-header { background: linear-gradient(180deg, #fffef7, #fff8da); border-bottom:1px solid rgba(242,195,0,.18); padding: 1.5rem 1.6rem 1.2rem; }
.login-card .card-body { padding: 1.6rem; }
.login-card .form-control { border-radius: 14px; min-height: 50px; }
.login-card .btn-primary { min-height: 50px; border-radius: 14px; font-weight: 800; }

/* Portal */
.portal-shell { min-height: 100vh; background: linear-gradient(180deg, #f6f7f8 0%, #eef0f3 100%); padding: 2rem 0; }
.portal-card { border:1px solid rgba(242,195,0,.16); border-radius: 28px; overflow:hidden; background:#fff; }
.portal-header-band { background: linear-gradient(135deg, #080808, #171717 65%, #1d1d1f); color:#fff; padding:1.8rem 2rem; }
.portal-header-band p { color: rgba(255,255,255,.76) !important; }
.portal-brand { display:flex; align-items:center; gap:1rem; }
.portal-brand img { width: 220px; max-width: 100%; height: 88px; border-radius: 18px; object-fit: contain; object-position: center; background: #fff; padding: 0.35rem 0.6rem; }
.portal-summary-card { border-radius: 20px; padding: 1.15rem 1.25rem; color:#111; background: linear-gradient(135deg, #fff7cf, #f2c300); }
.portal-summary-card--dark { background: linear-gradient(135deg, #0b0b0b, #212121); color:#fff; }
.portal-summary-card small { text-transform: uppercase; letter-spacing: .08em; display:block; opacity:.8; }

/* Invoice print */
.invoice-sheet.srd-invoice { border-radius: 18px; }
.srd-invoice .invoice-bar { background: linear-gradient(90deg, #f2c300, #d9ad00); height: 8px; }
.srd-invoice .invoice-meta .title,
.srd-invoice .panel-head,
.srd-invoice .box-head { color: #111 !important; background: #fff8da !important; }
.srd-invoice .invoice-table thead th { background: #111 !important; color:#f2c300 !important; }
.srd-invoice .logo-card { background:#fff; border-color: rgba(242,195,0,.45); }
.srd-invoice .totals-box { border-color: rgba(242,195,0,.35); }
.srd-invoice .total-row.grand { color:#111; }

/* Setup */
.setup-shell {
    min-height: 100vh; background: linear-gradient(180deg, #fbfbfc 0%, #f2f3f5 100%); padding: 2.5rem 1rem;
}
.setup-card { max-width: 1120px; margin:0 auto; background:#fff; border-radius: 30px; overflow:hidden; border:1px solid rgba(242,195,0,.18); }
.setup-top { background: linear-gradient(135deg, #080808, #161616 65%, #1f1f1f); color:#fff; padding: 2rem 2.2rem; }
.setup-top p { color: rgba(255,255,255,.74) !important; }
.setup-brand { display:flex; align-items:center; gap:1rem; margin-bottom:1rem; }
.setup-brand img { width: 240px; max-width: 100%; height: 96px; border-radius: 20px; object-fit: contain; object-position: center; background: #fff; padding: 0.4rem 0.65rem; }
.setup-body { padding: 2rem 2.2rem 2.2rem; }
.setup-note { background:#fff9e2; border:1px solid rgba(242,195,0,.22); border-radius:18px; padding:1rem 1.1rem; }

@media (max-width: 991.98px) {
    .login-split { grid-template-columns: 1fr; }
    .app-brand-logo { width: 108px; height: 40px; padding: 0; }
    .app-main-width { padding-left: 1rem; padding-right: 1rem; }
    .login-hero .brand-badge img,
    .portal-brand img,
    .setup-brand img { width: 190px; height: 80px; }
}


.metric-card__body > * { max-width: 100%; }


/* Final SRD polish patch */
body.srd-theme {
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}
.page-container {
    padding-top: .2rem;
}
.app-main-width {
    max-width: 1760px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.app-navbar {
    min-height: 76px;
}
.app-main-content > .row,
.app-main-content > .dashboard-hero,
.app-main-content > .card,
.app-main-content > .alert {
    margin-bottom: 1.35rem;
}
.card,
.dashboard-panel,
.metric-card,
.quick-action-tile,
.portal-card,
.login-card,
.setup-card,
.customer-highlight,
.table-responsive {
    border-radius: 20px;
}
.card,
.dashboard-panel,
.table-responsive,
.portal-card,
.login-card,
.setup-card {
    border: 1px solid rgba(15,23,42,.06);
    background: rgba(255,255,255,.97);
}
.metric-card {
    padding: 1.15rem 1.2rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.metric-card:hover,
.dashboard-panel:hover,
.quick-action-tile:hover,
.customer-highlight:hover,
.table-hover tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(15,23,42,.12);
}
.metric-card__label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.metric-card__value {
    font-size: clamp(1.45rem, 2vw, 2rem);
    margin-bottom: .35rem;
}
.metric-card__meta {
    font-size: .92rem;
}
.dashboard-panel__header {
    padding: 1.05rem 1.25rem;
}
.dashboard-panel .card-body,
.card .card-body {
    padding: 1.15rem 1.25rem;
}
.quick-action-grid {
    gap: 1rem;
}
.quick-action-tile {
    min-height: 110px;
    padding: 1rem 1.05rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}
.quick-action-tile strong,
.customer-highlight__name,
.table thead th,
.dashboard-panel h5,
.card-header h5,
.card-title {
    color: #111827 !important;
}
.quick-action-tile small,
.customer-highlight__meta,
.text-muted,
.table tbody td {
    color: #596273 !important;
}
.table-responsive {
    overflow: hidden;
}
.table,
.modern-table {
    margin-bottom: 0;
}
.table thead th,
.modern-table thead th {
    background: linear-gradient(180deg, #fffef7, #fff8da);
    border-bottom: 1px solid rgba(242,195,0,.28);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #2b2f36;
    padding-top: .9rem;
    padding-bottom: .9rem;
}
.table td,
.table th,
.modern-table tbody td {
    vertical-align: middle;
    padding: .88rem .95rem;
}
.table tbody tr,
.modern-table tbody tr {
    transition: background-color .16s ease;
}
.table-hover tbody tr:hover,
.modern-table tbody tr:hover {
    background: rgba(242,195,0,.05);
}
.table a,
.modern-table a {
    color: #111827;
    font-weight: 700;
}
.table a:hover,
.modern-table a:hover {
    color: #8a6b00;
    text-decoration: none;
}
.form-control,
.custom-select,
.btn {
    border-radius: 14px;
}
.form-control,
.custom-select {
    min-height: 46px;
    border-color: rgba(15,23,42,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.form-control:focus,
.custom-select:focus {
    border-color: rgba(242,195,0,.7);
    box-shadow: 0 0 0 .18rem rgba(242,195,0,.16);
}
.btn {
    font-weight: 700;
    letter-spacing: .01em;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover {
    transform: translateY(-1px);
}
.badge,
.modern-badge {
    border-radius: 999px;
    padding: .45rem .65rem;
    font-weight: 700;
}
.invoice-sheet,
.srd-invoice {
    font-size: .94rem;
}
.srd-invoice .invoice-table th,
.srd-invoice .invoice-table td {
    padding: .72rem .8rem;
}
.srd-invoice .totals-box,
.srd-invoice .panel,
.srd-invoice .logo-card,
.srd-invoice .meta-card {
    border-radius: 16px;
}
.report-toolbar,
.filters-bar,
.statement-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}
@media (max-width: 991.98px) {
    .app-brand {
        gap: .65rem;
    }
    .app-brand-title {
        font-size: .98rem;
    }
    .app-brand-subtitle {
        font-size: .68rem;
    }
    .app-main-width {
        padding-left: .9rem;
        padding-right: .9rem;
    }
    .dashboard-panel .card-body,
    .card .card-body,
    .dashboard-panel__header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}


/* Header overflow cleanup */
.app-navbar .navbar-collapse {
    align-items: center;
    min-width: 0;
}

.app-main-nav,
.app-user-nav {
    min-width: 0;
}

.app-main-nav {
    flex-wrap: nowrap;
}

.app-main-nav .nav-link span,
.app-user-nav .nav-link span,
.app-dropdown .dropdown-item {
    white-space: nowrap;
}

.app-user-nav {
    flex-shrink: 0;
}

@media (min-width: 1200px) {
    .app-navbar-inner {
        flex-wrap: nowrap;
    }

    .app-main-nav {
        margin-right: auto;
    }

    .app-user-nav {
        margin-left: 1rem;
    }
}

@media (max-width: 1399.98px) {
    .app-brand-logo {
        width: 96px;
    }

    .app-main-nav .nav-link,
    .app-user-nav .nav-link {
        padding: 0.58rem 0.8rem !important;
        font-size: 0.89rem;
    }
}

@media (max-width: 1199.98px) {
    .app-main-nav {
        flex-wrap: wrap;
    }

    .app-user-nav {
        gap: 0.35rem;
    }

    .app-user-nav .nav-link,
    .app-user-nav .app-icon-link {
        width: 100%;
        justify-content: flex-start;
    }

    .app-notification-nav {
        width: 100%;
    }
}
