/* RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* COLORS & TOKENS */
:root {
    --color-navy-dark: #152b3c;
    --color-navy: #1e3a57;
    --color-bg: #f3f6fb;
    --color-card: #ffffff;
    --color-accent: #ffb547;
    --color-accent-dark: #f49a1a;
    --color-text: #1b2431;
    --color-muted: #7e8a9a;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
}

/* GLOBAL */
body {
    margin: 0;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);

    /* big readable base font */
    font-size: 16px;
    line-height: 1.5;
}

/* LANDING PAGE */
.landing-body {
    background: linear-gradient(135deg, var(--color-navy-dark), #233754);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.landing-wrapper {
    padding: 24px;
    width: 100%;
    max-width: 480px;
}

.landing-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 32px 28px;
    text-align: center;
}

.landing-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 600;
}

.landing-text {
    margin: 0 0 24px;
    font-size: 16px;
    color: var(--color-muted);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: #1a1a1a;
    box-shadow: 0 8px 20px rgba(252, 186, 82, 0.5);
}

.btn-primary:hover {
    background: var(--color-accent-dark);
}

.btn-outline-sm {
    background: transparent;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 6px 14px;
    font-size: 12px;
    color: var(--color-text);
}

.btn-outline-sm:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-dark);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 14px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
}

.btn-danger:hover {
    background: #dc2626;
}

/* generic */
.mt-10 {
    margin-top: 10px;
}

/* ADMIN LAYOUT */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--color-navy-dark), #162536);
    color: #ffffff;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 30;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.sidebar-avatar {
    margin-right: 12px;
}

.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--color-navy-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.sidebar-user-email {
    margin: 4px 0 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}

/* SIDEBAR NAV */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 999px;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: #ffffff;
    color: var(--color-navy-dark);
}

.sidebar-link-logout {
    margin-bottom: 8px;
    background: rgba(239, 68, 68, 0.04);
    color: #fecaca;
}

.sidebar-link-logout:hover {
    background: rgba(239, 68, 68, 0.12);
}

.sidebar-footer {
    margin-top: 32px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* SIDEBAR OVERLAY (MOBILE) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 20;
}

.sidebar-overlay.overlay-show {
    display: block;
}

/* CONTENT AREA */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

/* TOPBAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 30px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: var(--color-navy);
    cursor: pointer;
    padding: 0;
}

.sidebar-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 2px 0;
    background: currentColor;
}

/* Logo area 100x300 */
.logo-area {
    width: 120px;
    max-width: 300px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo-area img {
    max-height: 40px;
    max-width: 100%;
    object-fit: contain;
}

.topbar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 0 0 auto;
}

.topbar-notifications {
    position: relative;
}

.topbar-bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: #fff;
    color: var(--color-navy);
    cursor: pointer;
}

.topbar-bell-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    padding: 0 5px;
    font-weight: 600;
}

.topbar-notification-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.15);
    z-index: 200;
}

.topbar-notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
}

.topbar-notification-list {
    max-height: 320px;
    overflow: auto;
}

.topbar-notification-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.topbar-notification-item:last-child {
    border-bottom: none;
}

.topbar-notification-item.is-unread {
    background: #f8fbff;
}

.topbar-notification-title {
    font-size: 13px;
    font-weight: 600;
}

.topbar-notification-title a {
    color: inherit;
    text-decoration: none;
}

.topbar-notification-title a:hover {
    text-decoration: underline;
}

.topbar-notification-text {
    font-size: 12px;
    color: #475569;
    margin-top: 2px;
}

.topbar-notification-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.topbar-notification-empty {
    padding: 14px 12px;
    font-size: 13px;
    color: #64748b;
}

.topbar-user-name {
    font-size: 16px;
    color: var(--color-muted);
}

.topbar-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

/* MAIN CONTENT */
.main-content {
    padding: 24px 30px 30px;
}

#ajax-content.ajax-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* CARDS */
.card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px 18px;
}

/* DASHBOARD */
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* STAT GRIDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 18px 20px;
}

.stat-earning {
    background: var(--color-navy);
    color: #ffffff;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    opacity: 0.95;
}

.stat-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
}

.stat-tag-excellent {
    background: rgba(46, 213, 115, 0.15);
    color: #b0ffd1;
}

.stat-card-body {
    margin-top: 18px;
}

.stat-amount {
    font-size: 28px;
    font-weight: 600;
    display: block;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    margin-top: 8px;
}

.stat-trend-up {
    color: #4ade80;
}

.stat-trend-up i {
    font-size: 10px;
}

.stat-card-label {
    font-size: 16px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 22px;
    font-weight: 600;
}

.stat-subtext {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--color-muted);
}

.stat-card-action {
    display: inline-flex;
    margin-top: 10px;
    font-size: 13px;
    color: var(--color-navy);
    text-decoration: none;
}

.stat-card-action:hover {
    text-decoration: underline;
}

/* CALENDAR + SIDE COLUMN */
.calendar-layout {
    display: grid;
    grid-template-columns: 2.4fr 1.1fr;
    gap: 18px;
}

/* Calendar card */
.calendar-card {
    padding-bottom: 22px;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.calendar-month-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-muted);
}

.calendar-month-label {
    font-weight: 500;
}

.calendar-nav-btn {
    border: none;
    background: transparent;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.calendar-nav-btn:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--color-text);
}

/* Calendar grid */
.calendar-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    font-size: 15px;
}

.calendar-day-name {
    font-weight: 500;
    text-align: center;
    color: var(--color-muted);
    padding-bottom: 6px;
}

.calendar-day {
    height: 40px;
    border-radius: 12px;
    background: #e6edf9;
    text-align: right;
    padding: 6px 8px;
    position: relative;
    color: var(--color-text);
}

.calendar-day.blank {
    background: transparent;
}

.calendar-day.has-event::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
}

/* RIGHT SIDE OF CALENDAR */
.calendar-side-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Donut card (Reviews Goal) */
.donut-wrapper {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 10px;
}

.donut-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--color-accent) 0 160deg, #e1e7f3 0 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-inner {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.donut-legend {
    font-size: 13px;
    color: var(--color-muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-primary {
    background: var(--color-navy);
}

.legend-accent {
    background: var(--color-accent);
}

/* Quick Actions */
.quick-card {
    padding-bottom: 20px;
}

.quick-text {
    margin: 6px 0 12px;
    font-size: 13px;
    color: var(--color-muted);
}

.quick-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    font-size: 16px;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.quick-btn i {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.quick-btn:hover {
    background: #fef6e8;
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

/* FOOTER */
.footer {
    padding: 16px 30px 22px;
    font-size: 14px;
    color: var(--color-muted);
    margin-top: auto;
}

/* GENERIC PAGE SECTIONS */
.page-section {
    background: transparent;
}

.page-heading {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
}

.page-text {
    margin: 0;
    font-size: 14px;
    color: var(--color-muted);
}

/* SETTINGS PAGE */
.settings-section {
    margin-top: 4px;
}

.settings-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 16px;
}

.settings-shell {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px 20px 24px;
}

/* hide the radio controls */
.settings-shell input[type="radio"] {
    display: none;
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
}

/* LEFT TABS */
.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    border-right: 1px solid #e2e8f0;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 17px;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-tab i {
    width: 18px;
    text-align: center;
}

/* default / inactive */
.settings-tab:hover {
    background: #f3f6fb;
}

/* ACTIVE STATES — controlled by radios */
#tab-profile:checked ~ .settings-layout .settings-tabs label[for="tab-profile"],
#tab-password:checked ~ .settings-layout .settings-tabs label[for="tab-password"],
#tab-google:checked   ~ .settings-layout .settings-tabs label[for="tab-google"],
#tab-branding:checked ~ .settings-layout .settings-tabs label[for="tab-branding"],
#tab-system:checked   ~ .settings-layout .settings-tabs label[for="tab-system"],
.settings-tab.is-active {
    background: #edf2ff;
    color: var(--color-navy);
    font-weight: 500;
}

/* MAIN AREA */
.settings-main {
    padding-left: 4px;
    min-width: 0;
}

/* panels hidden by default */
.settings-panel {
    display: none;
    min-width: 0;
}

#tab-profile:checked  ~ .settings-layout .panel-profile,
#tab-password:checked ~ .settings-layout .panel-password,
#tab-google:checked   ~ .settings-layout .panel-google,
#tab-branding:checked ~ .settings-layout .panel-branding,
#tab-system:checked   ~ .settings-layout .panel-system,
.settings-panel.is-active {
    display: block;
}

/* header row inside profile panel */
.settings-panel-header {
    margin-bottom: 18px;
}

.settings-avatar-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-avatar-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
    color: var(--color-navy);
}

.settings-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* forms */
.settings-form {
    margin-top: 4px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 16px;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 500;
    font-size: 16px;
}

.required {
    color: #ef4444;
}

.form-field input,
.form-field textarea {
    border-radius: 10px;
    border: 1px solid #d4dbe7;
    padding: 9px 11px;
    font-family: inherit;
    font-size: 17px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #f9fbff;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.settings-actions {
    margin-top: 20px;
}

/* panel headings */
.settings-panel-title {
    font-size: 20px;
    margin: 0 0 6px;
    font-weight: 600;
}

.settings-panel-subtext {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--color-muted);
}

/* Branding little row */
.branding-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.branding-hint {
    font-size: 16px;
    color: var(--color-muted);
}

/* SYSTEM & MODULES panel */
.system-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}

.system-card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    background: #f9fbff;
}

.system-card-label {
    font-size: 15px;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.system-card-value {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
}

.system-card-note {
    font-size: 16px;
    color: var(--color-muted);
    margin: 0;
}

.modules-block {
    margin-top: 6px;
    min-width: 0;
}

.modules-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.modules-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.modules-table th,
.modules-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}

.modules-table th {
    text-align: left;
    background: #f8fafc;
    font-weight: 500;
    color: var(--color-muted);
}

.modules-table tr:last-child td {
    border-bottom: none;
}

.modules-actions {
    text-align: right;
    padding-right: 10px;
}

.modules-actions .btn {
    width: 96px;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.15;
}

.modules-actions .btn + .btn {
    margin-top: 8px;
}

/* badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 14px;
}

.badge-disabled {
    background: #f1f5f9;
    color: #64748b;
}

/* install box */
.module-install-card {
    margin-top: 18px;
    border-radius: 14px;
    border: 1px dashed #d4dbe7;
    padding: 12px 12px 14px;
    background: #f9fbff;
    font-size: 16px !important;
}

.module-install-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-install-row form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.module-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.module-file-btn,
.module-upload-btn {
    width: 176px;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1.15;
}

.module-file-name {
    min-width: 130px;
    max-width: 260px;
    color: var(--color-muted);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* small tweak for code tag */
.module-install-card code {
    background: #0f172a;
    color: #e5e7eb;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 14px;
}

/* BRANDING: invoice template chooser */
.invoice-template-block {
    margin-top: 26px;
}

.invoice-template-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.invoice-template-card {
    position: relative;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 14px 14px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.invoice-template-card:hover {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.invoice-template-card-selected {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(255, 181, 71, 0.30);
}

.invoice-template-card > input[type="radio"] {
    position: absolute;
    top: 12px;
    right: 14px;
}

.invoice-template-thumb {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

.invoice-template-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.invoice-template-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.invoice-template-name {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.invoice-template-desc {
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-muted);
}

.invoice-template-actions {
    margin-top: 6px;
}

/* Branding success alert */
.settings-alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 15px;
}

.settings-alert-success {
    background: #ecfdf3;
    color: #166534;
    padding-bottom: 20px;
}

.settings-alert-error {
    background: #fef2f2;
    color: #991b1b;
    padding-bottom: 20px;
}

/* Template preview modal */
.template-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1900;
}

.template-modal-backdrop.show {
    display: flex;
}

.template-modal-dialog {
    width: 90%;
    max-width: 880px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 22px 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
}

.template-modal-header {
    margin-bottom: 10px;
}

.template-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.template-modal-body {
    flex: 1;
    overflow-y: auto;
}

.template-preview-image-wrap {
    border-radius: 14px;
    background: #f3f4f6;
    padding: 8px;
}

.template-preview-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.template-modal-note {
    margin-top: 10px;
    font-size: 14px;
    color: var(--color-muted);
}

.template-modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* TOPBAR brand area */
.topbar-logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-logo-img {
    display: block;
    max-height: 40px;
    max-width: 180px;
    object-fit: contain;
}

.topbar-logo-text {
    font-size: 18px;
    font-weight: 600;
}

.branding-logo-box img {
    display: block;
    max-width: 300px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Avatar circles – keep images small and cropped */
.settings-avatar-circle,
.avatar-circle,
.topbar-avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1623;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}

.settings-avatar-circle img,
.avatar-circle img,
.topbar-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================
   CLIENTS PAGE LAYOUT
   ============================ */

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.page-header-main {
    max-width: 60%;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toolbar */

.clients-toolbar-card {
    margin-bottom: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.clients-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.clients-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.clients-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* little filter chips */
.clients-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #d4dbe7;
    background: #f9fbff;
    font-size: 15px;
}

/* Search */

.clients-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.clients-search-submit {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.clients-search-icon {
    font-size: 16px;
    color: var(--color-muted);
    opacity: 0.7;
}

.clients-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #f5f7fb;
}

.clients-search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.clients-search-info {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

.clients-search-info strong {
    font-weight: 600;
}

.clear-search-link {
    margin-left: 4px;
    color: #2563eb;
    text-decoration: none;
}

.clear-search-link:hover {
    text-decoration: underline;
}

.search-error-text {
    color: #b91c1c;
}

/* Empty state */

.clients-empty-card {
    margin-top: 10px;
    text-align: left;
}

.clients-empty-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.clients-empty-text {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--color-muted);
}

/* Table */

.clients-table-card {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.clients-table thead tr {
    background: #f8fafc;
}

.clients-table th,
.clients-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
}

.clients-table tbody tr:hover {
    background: #f3f6fb;
}

/* Pills */

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 14px;
    background: #e5edff;
    color: var(--color-navy);
}

/* example color tweaks by status */
.status-new {
    background: #e5edff;
    color: #1d4ed8;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-lead,
.status-prospect {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive,
.status-archived {
    background: #e5e7eb;
    color: #374151;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    margin-right: 4px;
    margin-bottom: 3px;
}

/* Actions */

.clients-actions-col {
    width: 120px;
}

.clients-actions-cell {
    text-align: right;
}

.clients-actions-wrapper {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.clients-action-icon {
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    padding: 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    width: 32px;
    height: 32px;
}

.clients-action-icon i {
    font-size: 14px;
}

.clients-action-icon:hover {
    background: rgba(148, 163, 184, 0.16);
}

.clients-action-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* 3-dot actions menu */
.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-menu-trigger {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: #f3f4f6;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.actions-menu-trigger:hover {
    background: #e5e7eb;
}

.actions-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    z-index: 1200;
    padding: 6px;
}

.actions-menu-panel[hidden] {
    display: none !important;
}

.actions-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #0f172a;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.actions-menu-item:hover {
    background: #f8fafc;
}

.actions-menu-item.is-danger {
    color: #b91c1c;
}

/* ADD / EDIT CLIENT FORMS */

.clients-back-link {
    font-size: 16px;
    color: #4c1d95;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.clients-back-link:hover {
    text-decoration: underline;
}

.clients-form-card {
    margin-top: 6px;
    max-width: 100%;
}

.clients-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.clients-form-grid .form-field-full {
    grid-column: 1 / -1;
}

.clients-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
}

.clients-cancel-link {
    font-size: 16px;
    color: #4c1d95;
    text-decoration: none;
}

.clients-cancel-link:hover {
    text-decoration: underline;
}

/* MOBILE: clients table becomes stacked cards */

@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-main {
        max-width: 100%;
    }

    .clients-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .clients-toolbar-right {
        width: 100%;
    }

    .clients-search-input {
        width: 100%;
    }

    .clients-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .clients-table thead {
        display: none;
    }

    .clients-table tbody {
        display: block;
        width: 100%;
    }

    .clients-table tbody tr {
        display: block;
        width: 100%;
        background: #ffffff;
        border-radius: 22px;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
        padding: 16px 18px 12px;
        margin-bottom: 18px;
    }

    .clients-table tbody tr:last-child {
        margin-bottom: 4px;
    }

    .clients-table tbody td {
        display: block;
        width: 100%;
        border: 0;
        padding: 3px 0;
    }

    .clients-table tbody td[data-label="Name"] strong {
        font-size: 16px;
        font-weight: 700;
    }

    .clients-table tbody td[data-label="Company"],
    .clients-table tbody td[data-label="Phone"],
    .clients-table tbody td[data-label="Email"],
    .clients-table tbody td[data-label="Created"] {
        font-size: 14px;
        color: #4b5563;
    }

    .clients-table tbody td[data-label="Status"],
    .clients-table tbody td[data-label="Tags"] {
        margin-top: 6px;
    }

    .clients-actions-cell {
        margin-top: 10px;
        text-align: left;
    }

    .clients-actions-wrapper {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .clients-table-card {
        box-shadow: none;
        background: transparent;
        padding: 0 2px 12px;
    }

    .clients-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ===============================
   INVOICE LINE ITEMS – RESPONSIVE
   =============================== */

.invoice-items-card {
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.invoice-items-card table {
    width: 100%;
}

/* Desktop */
.invoice-line-items-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0 !important;
}

.invoice-line-items-table th,
.invoice-line-items-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 769px) {
    .invoice-line-items-table th,
    .invoice-line-items-table td {
        white-space: nowrap;
    }

    .invoice-line-items-table td:nth-child(2) input[type="text"] {
        width: 100%;
    }
}

/* Mobile: each row becomes a card with labels */

@media (max-width: 768px) {

    .invoice-line-items-table thead {
        display: none;
    }

    .invoice-line-items-table {
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }

    .invoice-line-items-table tbody {
        display: block;
    }

    .invoice-line-items-table tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 10px 10px 12px;
        border-radius: 14px;
        background: #f9fbff;
        border: 1px solid #e2e8f0;
        width: 100%;
        box-sizing: border-box;
    }

    .invoice-line-items-table td {
        display: block;
        width: 100%;
        padding: 4px 0;
        border-bottom: none;
        box-sizing: border-box;
    }

    .invoice-line-items-table select,
    .invoice-line-items-table input {
        width: 100%;
    }

    .invoice-line-items-table td:nth-child(1)::before {
        content: "Item";
        display: block;
        font-weight: 500;
        margin-bottom: 2px;
        color: var(--color-muted);
    }

    .invoice-line-items-table td:nth-child(2)::before {
        content: "Description";
        display: block;
        font-weight: 500;
        margin-bottom: 2px;
        color: var(--color-muted);
    }

    .invoice-line-items-table td:nth-child(3)::before {
        content: "Qty";
        display: block;
        font-weight: 500;
        margin-bottom: 2px;
        color: var(--color-muted);
    }

    .invoice-line-items-table td:nth-child(4)::before {
        content: "Unit price";
        display: block;
        font-weight: 500;
        margin-bottom: 2px;
        color: var(--color-muted);
    }

    .invoice-line-items-table td:nth-child(5)::before {
        content: "Line total";
        display: block;
        font-weight: 500;
        margin-bottom: 2px;
        color: var(--color-muted);
    }

    .invoice-line-items-table td:nth-child(6)::before {
        content: "";
    }

    .invoice-line-items-table td:nth-child(6) {
        text-align: right;
        margin-top: 4px;
    }

    .invoice-items-card {
        margin-left: 0;
        margin-right: 0;
        overflow-x: hidden;
    }
}

/* =========================================
   GLOBAL DELETE CONFIRMATION MODAL
   ========================================= */

.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.delete-modal-backdrop.hidden {
    display: none;
}

.delete-modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px 24px 20px;
    max-width: 420px;
    width: 92%;
}

.delete-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
}

.delete-modal-text {
    margin: 0 0 18px;
    font-size: 16px;
    color: var(--color-muted);
}

.delete-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.delete-modal-confirm-btn {
    min-width: 140px;
}

@media (max-width: 768px) {
    .delete-modal-dialog {
        width: 94%;
        padding: 18px 18px 18px;
    }

    .delete-modal-title {
        font-size: 18px;
    }

    .delete-modal-text {
        font-size: 15px;
    }
}

/* RESPONSIVE BREAKPOINTS */

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: 240px;
        z-index: 1200;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-overlay.overlay-show {
        z-index: 1100;
    }

    .content-area {
        margin-left: 0;
    }

    .topbar {
        padding: 12px 14px;
        gap: 8px;
        min-width: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        width: 38px;
        height: 38px;
    }

    .topbar-left {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-logo-area {
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-logo-img {
        max-width: 150px;
        max-height: 38px;
    }

    .topbar-right {
        gap: 6px;
        flex: 0 0 auto;
    }

    .topbar-bell-btn {
        width: 38px;
        height: 38px;
    }

    .topbar-user-info {
        max-width: 74px;
        overflow: hidden;
    }

    .topbar-user-name,
    .topbar-user-role {
        display: inline-block;
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-avatar-circle {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        font-size: 14px;
    }

    .topbar-notification-menu {
        position: fixed;
        top: 72px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }

    .main-content {
        padding: 18px 18px 24px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .card {
        border-radius: 16px;
        padding: 16px 16px;
    }

    .card.clients-table-card {
        padding: 16px 0px; /* Specific padding for the table card */
    }

    .logo-area {
        width: 90px;
    }

    .settings-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 10px;
        margin-bottom: 14px;
    }

    .settings-tab {
        font-size: 12px;
        padding: 7px 10px;
    }

    .system-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel-system .settings-panel-subtext {
        margin-bottom: 16px;
    }

    .modules-table-wrapper {
        width: 100%;
        overflow: visible;
    }

    .modules-table {
        min-width: 0;
        display: block;
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .modules-table thead {
        display: none;
    }

    .modules-table tbody {
        display: grid;
        gap: 12px;
    }

    .modules-table tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 5px;
        background: #ffffff;
        overflow: hidden;
    }

    .modules-table td {
        display: grid;
        grid-template-columns: minmax(82px, 32%) minmax(0, 1fr);
        gap: 10px;
        padding: 9px 10px;
        border-bottom: 1px solid #edf2f7;
        text-align: left !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .modules-table td::before {
        content: attr(data-label);
        color: var(--color-muted);
        font-size: 13px;
        font-weight: 600;
    }

    .modules-table td.modules-empty {
        display: block;
    }

    .modules-table td.modules-empty::before {
        content: none;
    }

    .modules-table td:last-child {
        border-bottom: 0;
    }

    .modules-actions .btn {
        width: 100%;
        min-height: 38px;
        padding: 8px 12px;
        margin: 0;
        white-space: normal;
        line-height: 1.15;
    }

    .modules-actions {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .modules-actions::before {
        margin-bottom: 2px;
    }

    .modules-actions .btn + .btn {
        margin-top: 8px;
    }

    .modules-header-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .modules-header-row .btn {
        flex: 0 1 auto;
        max-width: 140px;
        white-space: normal;
        line-height: 1.2;
    }

    .module-install-card {
        margin-top: 20px;
        padding: 14px 14px 18px;
    }

    .module-install-row,
    .module-install-row form {
        display: grid;
        width: 100%;
        gap: 10px;
    }

    .module-file-btn,
    .module-upload-btn {
        width: 100%;
        min-height: 40px;
    }

    .module-file-name {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .topbar-title {
        font-size: 16px;
    }

    .landing-card {
        padding: 24px 20px;
    }

    .landing-title {
        font-size: 24px;
    }
}

@media (max-width: 420px) {
    .topbar-logo-img {
        max-width: 132px;
    }

    .topbar-user-info {
        display: none;
    }
}

/* =========================================
   CLIENTS – MOBILE CARD LAYOUT
   Name / Company / Date / Tags / Phone / Email
   Status + Icons on right
   ========================================= */

@media (max-width: 768px) {

    /* Hide header row on mobile */
    .clients-table thead {
        display: none;
    }

    /* Turn the table body into a vertical list of cards */
    .clients-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .clients-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .clients-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name   status"
            "company status"
            "date   actions"
            "tags   actions"
            "phone  actions"
            "email  actions";
        border-radius: 18px;
        background: #ffffff;
        box-shadow: var(--shadow-soft);
        padding: 12px 14px;
    }

    .clients-table td {
        border: none;
        padding: 2px 0;
        font-size: 0.95rem;
    }

    /* Map each column into a grid area
       (column order in HTML:
        1 Name, 2 Company, 3 Phone, 4 Email,
        5 Status, 6 Tags, 7 Created, 8 Actions)
    */
    .clients-table td:nth-child(1) { /* Name */
        grid-area: name;
    }

    .clients-table td:nth-child(2) { /* Company */
        grid-area: company;
    }

    .clients-table td:nth-child(7) { /* Created date */
        grid-area: date;
    }

    .clients-table td:nth-child(6) { /* Tags (Good Lead, VIP, etc.) */
        grid-area: tags;
        margin-top: 4px;
    }

    .clients-table td:nth-child(3) { /* Phone */
        grid-area: phone;
        margin-top: 4px;
    }

    .clients-table td:nth-child(4) { /* Email */
        grid-area: email;
    }

    .clients-table td:nth-child(5) { /* Status pill */
        grid-area: status;
        text-align: right;
        align-self: flex-start;
    }

    .clients-table td:nth-child(8) { /* Actions (edit / delete) */
        grid-area: actions;
        text-align: right;
        align-self: flex-start;
        margin-top: 6px;
    }

    /* Typography inside the card to match your screenshot */

    /* Name – big and bold at top left */
    .clients-table td:nth-child(1) strong {
        font-size: 1.05rem;
        font-weight: 700;
    }

    /* Company + date slightly smaller, stacked under name */
    .clients-table td:nth-child(2),
    .clients-table td:nth-child(7) {
        font-size: 0.9rem;
        color: var(--color-text);
    }

    /* Phone & email under the tag */
    .clients-table td:nth-child(3),
    .clients-table td:nth-child(4) {
        font-size: 0.9rem;
    }

    /* Tag row – keep the pill(s) on their own line */
    .clients-table td:nth-child(6) .tag-pill {
        margin-right: 4px;
        margin-bottom: 2px;
    }

    /* Status pill in top-right corner */
    .clients-table td:nth-child(5) .status-pill {
        font-size: 0.85rem;
    }

    /* Edit/Delete icons right under the status */
    .clients-actions-cell {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .clients-action-icon i {
        font-size: 1.05rem;
    }

    /* Make sure the overall clients section never scrolls sideways */
    .clients-table-card {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
}

/* =========================================
   Calendar – Appointments side panel
   ========================================= */

.appointments-card {
    padding: 16px 18px 18px;
}

.appointments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.appointments-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--color-muted);
}

.appointments-filters {
    margin-top: 4px;
    margin-bottom: 8px;
}

.appointments-filters-row {
    display: grid;
    grid-template-columns: 1.1fr 2fr auto;
    gap: 10px;
    align-items: flex-end;
}

.appointments-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-muted);
}

.appointments-select {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d4dbe7;
    padding: 7px 10px;
    font-size: 15px;
    background: #f9fbff;
    outline: none;
}

.appointments-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.appointments-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.appointments-search-icon {
    position: absolute;
    left: 10px;
    font-size: 14px;
    color: var(--color-muted);
    opacity: 0.8;
}

.appointments-search-input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d4dbe7;
    padding: 8px 12px 8px 30px;
    font-size: 15px;
    background: #f9fbff;
    outline: none;
}

.appointments-search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.appointments-filter-button-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.appointments-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appointments-empty {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--color-muted);
}

/* Appointment card look – same vibe as clients cards on mobile */
.appointment-item {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    background: #f9fbff;
}

.appointment-main-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.appointment-main-left {
    flex: 1 1 auto;
}

.appointment-main-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.appointment-title {
    font-size: 16px;
    font-weight: 600;
}

.appointment-client {
    font-size: 15px;
    margin-top: 2px;
}

.appointment-time,
.appointment-location {
    font-size: 14px;
    color: var(--color-muted);
    margin-top: 2px;
}

.appointment-notes {
    margin-top: 6px;
    font-size: 14px;
    color: var(--color-muted);
}

/* Selected day styling inside calendar */
.calendar-day-selected {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

/* Mobile tweaks: appointments panel stacks nicely */
@media (max-width: 768px) {
    .appointments-filters-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .appointments-filter-button-wrap {
        justify-content: flex-start;
    }

    .appointment-main-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .appointment-main-right {
        align-items: flex-start;
    }
}

/* =======================
   CALENDAR PAGE TOOLBAR
   ======================= */

.calendar-toolbar-card {
    margin-top: 10px;
    margin-bottom: 18px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.calendar-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-filter-label {
    font-size: 15px;
    color: var(--color-muted);
}

.calendar-filter-select {
    border-radius: 999px;
    border: 1px solid #d4dbe7;
    padding: 8px 12px;
    font-size: 15px;
    background: #f9fbff;
    outline: none;
}

.calendar-filter-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.calendar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.calendar-search-icon {
    position: absolute;
    left: 10px;
    font-size: 16px;
    color: var(--color-muted);
    opacity: 0.7;
}

.calendar-search-input {
    border-radius: 999px;
    border: 1px solid #d4dbe7;
    padding: 8px 12px 8px 32px;
    font-size: 15px;
    background: #f5f7fb;
    min-width: 220px;
}

.calendar-search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

.calendar-filter-apply {
    border-radius: 999px;
    padding-inline: 18px;
    font-size: 15px;
}

.calendar-clear-link {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
}

.calendar-clear-link:hover {
    text-decoration: underline;
}

/* =========================
   CALENDAR PAGE 2-CARD LAYOUT
   ========================= */

.calendar-page-layout {
    margin-top: 4px;
}

.calendar-month-card {
    padding-bottom: 22px;
}

.calendar-appointments-card {
    padding-bottom: 22px;
}

/* Month header + nav */

.calendar-month-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.calendar-month-title {
    font-size: 20px;
    font-weight: 600;
}

.calendar-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* nav buttons – remove ugly lines / borders */
.calendar-nav-btn {
    border: none;
    background: transparent;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-muted);
    text-decoration: none;
}

.calendar-nav-btn i {
    font-size: 14px;
}

.calendar-nav-btn:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--color-text);
}

.calendar-nav-btn:focus {
    outline: none;
}

.calendar-nav-today {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-muted);
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid transparent;
}

.calendar-nav-today:hover {
    border-color: #d4dbe7;
    background: #f8fafc;
}

/* day name + grid tweaks */
.calendar-grid-header {
    margin-top: 4px;
    margin-bottom: 4px;
}

.calendar-grid-body {
    margin-top: 2px;
}

/* day cells – rounded buttons */
.calendar-day {
    position: relative;
    border-radius: 16px;
    background: #e6edf9;
    padding: 0;
}

.calendar-day.blank {
    background: transparent;
}

.calendar-day-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    text-decoration: none;
    color: var(--color-text);
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.calendar-day-link:focus {
    outline: none;
}

.calendar-day-number {
    font-size: 15px;
    font-weight: 500;
}

.calendar-day-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--color-accent);
}

/* today + selected states */
.calendar-day-today .calendar-day-link {
    border: 2px solid rgba(255, 181, 71, 0.9);
    background: #fef6e8;
}

.calendar-day-selected .calendar-day-link {
    border: 2px solid rgba(37, 99, 235, 0.85);
    background: #e0ecff;
}

.calendar-day-has-appt .calendar-day-link {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
}

/* =========================
   APPOINTMENTS CARD
   ========================= */

.calendar-appointments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.calendar-appointments-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.calendar-appointments-date {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--color-muted);
}

.calendar-appointments-empty,
.calendar-appointments-error {
    margin: 8px 0 0;
    font-size: 15px;
    color: var(--color-muted);
}

.calendar-appointments-error {
    color: #b91c1c;
}

.calendar-appointments-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px; /* keep similar height to calendar */
    overflow-y: auto;
}

/* individual appointment card */
.calendar-appointment-card {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f9fbff;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-appointment-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-appointment-title {
    font-size: 16px;
    font-weight: 600;
}

.calendar-appointment-client {
    font-size: 15px;
}

.calendar-appointment-location {
    font-size: 14px;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-appointment-location i {
    font-size: 13px;
}

.calendar-appointment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.calendar-appointment-time {
    font-size: 14px;
    font-weight: 500;
}

/* status pill */
.appt-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    text-transform: capitalize;
    background: #e5edff;
    color: #1d4ed8;
}

/* variations */
.appt-status-upcoming   { background: #e0f2fe; color: #075985; }
.appt-status-completed  { background: #dcfce7; color: #166534; }
.appt-status-cancelled  { background: #fee2e2; color: #b91c1c; }
.appt-status-missed     { background: #fef3c7; color: #92400e; }

.calendar-appointment-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-appt-icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-appt-icon-btn i {
    font-size: 16px;
}

.calendar-appt-icon-btn:hover {
    background: rgba(148, 163, 184, 0.16);
}

.calendar-appt-icon-danger i {
    color: #b91c1c;
}

/* =========================
   CALENDAR PAGE – MOBILE
   ========================= */

@media (max-width: 992px) {
    .calendar-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-toolbar-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .calendar-search-input {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .calendar-appointments-list {
        max-height: none;
    }
}
/* =========================
   CALENDAR MODALS & TIME UI
   ========================= */

.calendar-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.calendar-modal-backdrop.show {
    display: flex;
}

.calendar-modal-dialog {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 22px;
    padding: 26px 28px 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

/* Header */

.calendar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.calendar-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.calendar-modal-close {
    border: none;
    background: #eef1f7;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Body */

.calendar-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.calendar-modal-error {
    margin: 0;
    font-size: 14px;
    color: #b91c1c;
}

/* Grid rows */

.calendar-modal-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field-full {
    grid-column: 1 / -1;
}

/* Labels + controls */

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #d4dbe7;
    background: #f5f7fb;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.35);
    background: #ffffff;
}

/* Time selects */

.calendar-time-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calendar-time-group .time-hour,
.calendar-time-group .time-minute,
.calendar-time-group .time-ampm {
    flex: 1 1 auto;
}

/* Footer buttons */

.calendar-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.calendar-modal-footer .btn {
    border-radius: 999px;
    padding-inline: 18px;
    font-size: 14px;
}

/* Mobile */

@media (max-width: 600px) {
    .calendar-modal-dialog {
        max-width: 100%;
        padding: 20px 18px 18px;
    }

    .calendar-modal-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- Settings: Alert Banner ---------- */
.settings-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.18); /* soft green border */
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.10),
        rgba(34, 197, 94, 0.03)
    );
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    margin: 16px 0 24px; /* padding below the banner */
    animation: settings-alert-in 0.25s ease-out;
}

.settings-alert-success {
    /* if later you want error / warning variants, you can add more here - FUTURE */
    text-decoration: none;
}

.settings-alert-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #22c55e;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
    font-size: 14px;
}

.settings-alert-body {
    flex: 1;
    min-width: 0;
}

.settings-alert-title {
    font-weight: 600;
    font-size: 14px;
    color: #064e3b;
    margin-bottom: 2px;
}

.settings-alert-text {
    font-size: 13px;
    color: #065f46;
    line-height: 1.45;
}

.settings-alert-close {
    border: none;
    background: transparent;
    color: #047857;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.settings-alert-close:hover {
    opacity: 0.75;
    transform: scale(1.08);
}

@keyframes settings-alert-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MODULE PAGES --- */
.module-page {
    padding: 20px;
}

.module-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.module-subtitle {
    font-size: 15px;
    color: #555;
    margin-bottom: 25px;
}

.module-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.module-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.module-card-text {
    font-size: 15px;
    margin-bottom: 10px;
}

.module-feature-list {
    margin: 0;
    padding-left: 18px;
}

.module-feature-list li {
    margin-bottom: 6px;
    font-size: 14px;
}

/* -----------------------------------------
   Snapshots – compact filter bar
   ------------------------------------- */

.snapshots-filter-card {
  padding: 16px 20px;
}

.snapshots-filter-form {
  width: 100%;
}

.snapshots-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

/* Base field sizing */
.snapshots-filter-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 0;
}

/* === Snapshots filter toolbar === */
.snapshots-filter-card {
    padding: 16px 24px;
    margin-bottom: 16px;
}

.snapshots-filter-form {
    width: 100%;
}

.snapshots-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

/* Each field behaves like a column in the row */
.snapshots-filter-field {
    flex: 1 1 0;
    min-width: 160px;
}

/* Client dropdown can be a bit wider */
.snapshots-filter-field--client {
    flex: 1.5 1 0;
    min-width: 220px;
}

/* Right-side Filter button */
.snapshots-filter-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: flex-end;
}

.snapshots-filter-actions .btn {
    white-space: nowrap;
}

/* Mobile: stack everything nicely */
@media (max-width: 992px) {
    .snapshots-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .snapshots-filter-actions {
        margin-left: 0;
        justify-content: flex-start;
    }

    .snapshots-filter-actions .btn {
        width: 100%;
    }
}


/* Make client + notes a bit wider on desktop */
.snapshots-filter-client {
  flex: 1.2 1 220px;
}

.snapshots-filter-notes {
  flex: 1.5 1 260px;
}

.snapshots-filter-actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

/* Button height aligns with inputs */
.snapshots-filter-actions .btn {
  margin-top: 22px; /* lines up with label+input height */
}

/* Mobile: stack fields nicely */
@media (max-width: 768px) {
  .snapshots-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .snapshots-filter-actions {
    justify-content: flex-start;
  }

  .snapshots-filter-actions .btn {
    margin-top: 4px;
    width: 100%;
  }
}

/* Snapshots filter – modern form controls */
.snapshots-filter-card label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280; /* soft gray label */
    margin-bottom: 4px;
}

/* Base style for all controls in the toolbar */
.snapshots-filter-card select,
.snapshots-filter-card input[type="date"],
.snapshots-filter-card input[type="text"] {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d1d9e6;
    background-color: #f9fafb;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
}

/* Hover / focus states */
.snapshots-filter-card select:hover,
.snapshots-filter-card input[type="date"]:hover,
.snapshots-filter-card input[type="text"]:hover {
    border-color: #c4cde0;
    background-color: #ffffff;
}

.snapshots-filter-card select:focus,
.snapshots-filter-card input[type="date"]:focus,
.snapshots-filter-card input[type="text"]:focus {
    border-color: #ffb547; /* your accent gold */
    box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.25);
    background-color: #ffffff;
}

/* Make the date + select controls look consistent across browsers */
.snapshots-filter-card select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #9ca3af 50%),
        linear-gradient(135deg, #9ca3af 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px; /* room for arrow */
}

.snapshots-filter-card input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
}

.snapshots-filter-card input[type="date"] {
    padding-right: 34px; /* room for calendar icon */
}

/* Button in the toolbar – keep it compact but modern */
.snapshots-filter-actions .btn {
    border-radius: 999px;
    padding-inline: 18px;
    padding-block: 9px;
    font-size: 14px;
}

.padbottom10 {
    padding-bottom: 10px;
}

.padtop10 {
    padding-top: 10px;
}

.margintop10 {
    margin-top: 10px;
}

.marginbottom10 {
    margin-bottom: 10px;
}

/* SNAPSHOTS EXTRA CSS FOR MODAL */
.snapshot-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.snapshot-lightbox-inner {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.snapshot-lightbox-inner img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    display: block;
    background: #000;
}

.snapshot-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #fff;
    color: #111827;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
}

.snapshot-lightbox-backdrop[hidden] {
    display: none !important;
}

/* Global CRM radius rule: controls must not render as pills. */
:where(
    button,
    .btn,
    .btn-primary,
    .btn-outline-sm,
    .btn-sm,
    .btn-xs,
    .btn-danger,
    .quick-btn,
    .topbar-bell-btn,
    .calendar-nav-btn,
    .calendar-appt-icon-btn,
    .actions-menu-trigger,
    .actions-menu-item,
    .view-pill,
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .clients-search,
    .clients-search-input,
    .clients-search-submit,
    .appointments-search-inner,
    .appointments-search-input,
    .appointments-select,
    .calendar-search,
    .calendar-search-input,
    .calendar-filter-select,
    .snapshots-filter-card input,
    .snapshots-filter-card select,
    .snapshots-filter-actions .btn,
    .settings-tab,
    [class*="pill"],
    .status-pill,
    .tag-pill,
    .badge,
    .appt-status-pill
) {
    border-radius: 5px !important;
}
