:root {
    --bg: #f6f1e8;
    --bg-strong: #efe6d7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --text: #1e293b;
    --muted: #5f6c7b;
    --line: rgba(148, 163, 184, 0.22);
    --brand: #0f766e;
    --brand-strong: #115e59;
    --accent: #c2410c;
    --shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 26%),
        radial-gradient(circle at top right, rgba(194, 65, 12, 0.1), transparent 24%),
        linear-gradient(180deg, #fcfaf6 0%, var(--bg) 100%);
    min-height: 100vh;
}

a {
    color: var(--brand-strong);
}

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

.app-shell {
    min-height: 100vh;
    padding: 20px;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 14px 20px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text) !important;
}

.app-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.app-brand small {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.navbar-nav .nav-link {
    color: var(--text) !important;
    font-weight: 700;
    border-radius: 999px;
    padding: 10px 14px !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .show > .nav-link {
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-strong) !important;
}

.dropdown-menu {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 8px;
}

.dropdown-item {
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 12px;
}

.dropdown-item:hover {
    background: rgba(15, 118, 110, 0.08);
}

.app-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    padding: 10px 16px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.app-btn:hover {
    transform: translateY(-1px);
}

.app-btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: 0 12px 22px rgba(15, 118, 110, 0.24);
}

.app-btn-primary:hover {
    color: #fff;
}

.app-btn-secondary {
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-strong);
}

.app-btn-muted {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text);
}

.app-main {
    padding: 22px 0 10px;
}

.app-messages {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.app-message {
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.app-message.success {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.app-message.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.app-message.error,
.app-message.danger {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.app-message.info {
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-strong);
}

.page-frame {
    display: grid;
    gap: 22px;
}

.hero-panel,
.content-card,
.metric-card,
.table-card,
.filters-card,
.form-shell,
.detail-grid,
.detail-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-panel {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.hero-panel h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.hero-panel p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.02rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.metrics-grid,
.dashboard-grid {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.content-card,
.table-card,
.filters-card,
.form-shell,
.detail-card {
    padding: 22px;
}

.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.2fr 1fr;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.detail-card {
    min-width: 0;
}

.detail-card h2 {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 800;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.meta-item {
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.meta-value {
    font-weight: 700;
}

.metric-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 8px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.stack-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stack-list li {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.stack-list strong {
    display: block;
    font-size: 1rem;
}

.stack-list span {
    color: var(--muted);
    font-size: 0.9rem;
}

.page-actions,
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filters-row .search-container {
    flex: 1 1 280px;
}

.filters-row .form-control {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    box-shadow: none;
    min-height: 48px;
    padding-right: 42px;
}

.clear-button {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    display: none;
}

.table-card {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 800;
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
    border-color: var(--line);
}

.table tbody tr:hover {
    background: rgba(15, 118, 110, 0.04);
}

.notes-cell {
    min-width: 220px;
    max-width: 320px;
    white-space: pre-wrap;
    color: var(--muted);
}

.action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: rgba(15, 118, 110, 0.08);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.form-shell {
    max-width: 960px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    margin-bottom: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text);
}

.form-control,
select.form-control,
textarea.form-control {
    min-height: 48px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    padding: 12px 14px;
}

textarea.form-control {
    min-height: 120px;
}

.form-help {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.form-errors,
.form-errors ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    color: #991b1b;
    font-size: 0.84rem;
    font-weight: 700;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-strong);
    font-weight: 700;
}

.empty-state {
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-lg);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
}

.truncate-cell {
    max-width: 180px;
    color: var(--muted);
}

.truncate-cell > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.login-container {
    max-width: 420px;
    margin: 10vh auto;
    padding: 28px;
    background: rgba(255, 255, 255, 0.84);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 800;
}

.login-container form p {
    margin-bottom: 14px;
}

.login-container input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    padding: 12px 14px;
}

.login-container button {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    font-weight: 800;
}

.client-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.client-page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.client-page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.client-primary-link,
.client-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 800;
}

.client-primary-link {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: 0 12px 22px rgba(15, 118, 110, 0.2);
}

.client-primary-link:hover {
    color: #fff;
}

.client-secondary-link {
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-strong);
}

.client-section-card {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

.client-section-heading {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 800;
}

.client-name-link {
    font-weight: 800;
}

.client-action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 220px;
}

.client-action-cell a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    font-size: 0.84rem;
    font-weight: 700;
}

.client-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.client-detail-span {
    grid-column: 1 / -1;
}

.client-simple-list {
    margin: 0;
    padding-left: 18px;
}

.client-simple-list li + li {
    margin-top: 8px;
}

.client-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.client-form-card {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.85) !important;
    box-shadow: var(--shadow) !important;
}

.client-form-submit {
    border: none;
    border-radius: 12px;
    font-weight: 800;
    padding: 12px 16px;
}

.client-delete-card {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 26%),
        linear-gradient(135deg, #134e4a, #0f766e 54%, #115e59);
    color: #f8fafc;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero h1,
.dashboard-hero a {
    color: inherit;
}

.dashboard-hero p {
    color: rgba(248, 250, 252, 0.82);
}

.dashboard-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-hero-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.dashboard-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) 320px;
    align-items: stretch;
}

.dashboard-hero-main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.dashboard-hero-side {
    display: grid;
    gap: 12px;
}

.dashboard-side-card,
.dashboard-side-mini {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 18px;
}

.dashboard-side-label {
    color: rgba(248, 250, 252, 0.74);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    font-weight: 800;
}

.dashboard-side-value {
    margin-top: 8px;
    font-size: 3rem;
    line-height: 1;
    font-weight: 800;
}

.dashboard-side-copy {
    margin-top: 8px;
    color: rgba(248, 250, 252, 0.8);
}

.dashboard-side-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-side-mini span {
    display: block;
    color: rgba(248, 250, 252, 0.74);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.dashboard-side-mini strong {
    display: block;
    margin-top: 8px;
    font-size: 1.6rem;
    font-weight: 800;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.84rem;
    font-weight: 700;
}

.dashboard-hero .app-btn-secondary,
.dashboard-hero .app-btn-muted {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.dashboard-hero .app-btn-primary {
    background: linear-gradient(135deg, #fff, #f8fafc);
    color: var(--brand-strong);
}

.dashboard-metrics {
    align-items: stretch;
}

.dashboard-metric-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.76));
}

.dashboard-metric-primary {
    background: linear-gradient(135deg, rgba(15,118,110,0.12), rgba(255,255,255,0.84));
}

.dashboard-metric-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.dashboard-spotlight-grid {
    display: grid;
}

.dashboard-spotlight {
    background:
        radial-gradient(circle at top right, rgba(194, 65, 12, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.78));
}

.dashboard-spotlight-grid-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-spotlight-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.dashboard-spotlight-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.dashboard-spotlight-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    font-weight: 800;
}

.dashboard-spotlight-card p {
    margin: 10px 0 0;
    color: var(--muted);
}

.dashboard-panels {
    align-items: start;
}

.dashboard-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.8));
}

.dashboard-panel-wide {
    grid-column: span 2;
}

.dashboard-list li {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-list li:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

@media (max-width: 991px) {
    .app-shell {
        padding: 12px;
    }

    .hero-panel {
        flex-direction: column;
    }

    .metrics-grid,
    .dashboard-grid,
    .dashboard-hero-grid,
    .dashboard-spotlight-grid-inner,
    .detail-grid,
    .form-grid,
    .detail-meta,
    .client-detail-grid {
        grid-template-columns: 1fr;
    }

    .client-page-header {
        flex-direction: column;
    }

    .dashboard-panel-wide {
        grid-column: span 1;
    }

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