/* ==========================================================================
   Indian Wedding Management SaaS — Global Application Styles
   Colors below are CSS custom properties injected at runtime by ThemeService
   (see /theme.css). Never hardcode brand colors in this file.
   ========================================================================== */

@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/lato/lato-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/lato/lato-bold.woff2') format('woff2');
}

/* ---- Design tokens (radius / shadow / spacing) ----
   Colors live in /theme.css (DB-driven via ThemeService); these are the
   structural tokens from the shared design spec. */
:root {
    --wed-radius-btn: .5rem;      /* 8px  — tightened in the compact-density pass */
    --wed-radius-input: .5rem;    /* 8px  */
    --wed-radius-card: .75rem;    /* 12px */
    --wed-radius-modal: .875rem;  /* 14px */
    --wed-radius-badge: 999px;
    --wed-radius-table: .625rem;  /* 10px */

    --wed-shadow-sm: 0 2px 8px rgba(0, 0, 0, .05);
    --wed-shadow-md: 0 8px 20px rgba(0, 0, 0, .08);
    --wed-shadow-lg: 0 15px 40px rgba(0, 0, 0, .10);
}
[data-theme="dark"] {
    --wed-shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
    --wed-shadow-md: 0 8px 20px rgba(0, 0, 0, .45);
    --wed-shadow-lg: 0 15px 40px rgba(0, 0, 0, .55);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--wed-font, 'Lato', sans-serif);
    color: var(--wed-text, #2A2A2A);
    background-color: var(--wed-body-bg, #FDF1B5);
    transition: background-color .25s ease, color .25s ease;
}

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

a:hover {
    color: var(--wed-primary);
    opacity: .85;
}

.text-wed-primary { color: var(--wed-primary) !important; }
.text-wed-accent { color: var(--wed-accent) !important; }
.bg-wed-primary { background-color: var(--wed-primary) !important; }
.bg-wed-surface { background-color: var(--wed-surface) !important; }

/* ---- Buttons ---- */
.btn {
    border-radius: var(--wed-radius-btn);
    font-weight: 600;
    letter-spacing: .01em;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn:not(.btn-sm):not(.btn-lg) {
    min-height: 38px;
    padding: .4rem 1.05rem;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--wed-button);
    border-color: var(--wed-button);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--wed-button);
    border-color: var(--wed-button);
    filter: brightness(0.92);
    transform: translateY(-1px);
}

/* ---- Cards ---- */
.card {
    background-color: var(--wed-surface, #fff);
    border: 1px solid #ECECEC;
    border-radius: var(--wed-radius-card);
    box-shadow: var(--wed-shadow-sm);
}
.card-body {
    padding: 1.15rem;
}
/* Many views use `<div class="card p-4">` as a padded container. Bootstrap's
   .p-4 is `padding: 1.5rem !important`, which is too bulky for the compact
   density and can't be out-cascaded without an equally-!important, more-specific
   rule. `.card.p-4` (0,2,0) beats `.p-4` (0,1,0), so this compacts every such
   card portal-wide without touching 100+ view files. Same for the tighter p-3. */
.card.p-4 { padding: 1.15rem !important; }
.card.p-3 { padding: 1rem !important; }

[data-theme="dark"] .card {
    border-color: rgba(255, 255, 255, .06);
}

.card-glass {
    background: color-mix(in srgb, var(--wed-surface) 70%, transparent);
    backdrop-filter: blur(16px);
    border: 1px solid color-mix(in srgb, var(--wed-primary) 15%, transparent);
}

/* ---- Forms ---- */
.form-control,
.form-select {
    border-radius: var(--wed-radius-input);
    border: 1px solid #E5E7EB;
    padding: .45rem .8rem;
    min-height: 40px;
    background-color: var(--wed-surface, #fff);
    color: var(--wed-text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    border-color: rgba(255, 255, 255, .18);
}

[data-theme="dark"] .form-control::placeholder {
    color: rgba(255, 255, 255, .35);
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly] {
    background-color: color-mix(in srgb, var(--wed-surface) 85%, white 5%);
    opacity: .8;
}

[data-theme="dark"] .form-control[type="file"]::file-selector-button {
    background-color: var(--wed-primary);
    color: #fff;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.form-control:focus,
.form-select:focus {
    border-color: var(--wed-primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--wed-primary) 20%, transparent);
    background-color: var(--wed-surface, #fff);
    color: var(--wed-text);
}

.form-label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--wed-text);
}

/* ---- Modals ---- */
.modal-content {
    border: none;
    border-radius: var(--wed-radius-modal);
    box-shadow: var(--wed-shadow-lg);
    background-color: var(--wed-surface, #fff);
    color: var(--wed-text);
}
.modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl) {
    max-width: 600px;
}
.modal-header,
.modal-footer {
    border-color: rgba(0, 0, 0, .06);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, .08);
}
.modal-backdrop.show {
    backdrop-filter: blur(2px);
}

/* ---- Dropdown menus ---- */
.dropdown-menu {
    border: 1px solid #ECECEC;
    border-radius: var(--wed-radius-card);
    box-shadow: var(--wed-shadow-md);
    padding: .4rem;
    background-color: var(--wed-surface, #fff);
    color: var(--wed-text);
}
.dropdown-item {
    border-radius: var(--wed-radius-btn);
    padding: .5rem .7rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--wed-text);
    display: flex;
    align-items: center;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: color-mix(in srgb, var(--wed-primary) 10%, transparent);
    color: var(--wed-text);
}
.dropdown-header {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    opacity: .6;
    padding: .5rem .7rem .25rem;
}
.dropdown-divider { border-color: rgba(0, 0, 0, .08); margin: .35rem .2rem; }
[data-theme="dark"] .dropdown-menu { border-color: rgba(255, 255, 255, .08); }
[data-theme="dark"] .dropdown-divider { border-color: rgba(255, 255, 255, .1); }
/* The wedding "Manage" menu can list many modules — cap height and scroll. */
.wed-manage-menu { max-height: 72vh; overflow-y: auto; min-width: 250px; }

.is-invalid {
    border-color: #d9534f !important;
}

.invalid-feedback {
    color: #d9534f;
    font-size: .8rem;
}

/* ---- Tables ---- */
.table {
    --bs-table-border-color: rgba(0, 0, 0, .05);
    margin-bottom: 0;
    color: var(--wed-text);
}
[data-theme="dark"] .table {
    --bs-table-border-color: rgba(255, 255, 255, .07);
    color: var(--wed-text);
}
/* Cleaner header: no heavy band, just an uppercase muted label over a thin divider. */
.table > thead > tr > th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--wed-text);
    opacity: .5;
    background: transparent;
    border-bottom: 1px solid var(--bs-table-border-color);
    padding: .55rem .75rem;
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: .6rem .75rem;
    vertical-align: middle;
    border-color: var(--bs-table-border-color);
}
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table > tbody > tr:hover > td {
    background-color: color-mix(in srgb, var(--wed-primary) 4%, transparent);
}

/* ---- Form niceties ---- */
.form-label { margin-bottom: .35rem; }
.form-text { color: var(--wed-text); opacity: .6; }
.input-group-text {
    background-color: color-mix(in srgb, var(--wed-text) 4%, transparent);
    border-color: #E5E7EB;
    color: var(--wed-text);
}
[data-theme="dark"] .input-group-text { border-color: rgba(255, 255, 255, .18); }

/* ---- Toasts ---- */
.toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 380px;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--wed-surface, #fff);
    color: var(--wed-text);
    border-radius: var(--wed-radius-card);
    padding: .85rem 1rem;
    box-shadow: var(--wed-shadow-md);
    border-left: 4px solid var(--wed-primary);
    animation: wed-toast-in .25s ease;
    font-size: .9rem;
}

.toast-item.toast-success { border-left-color: var(--wed-success, #2E9E6D); }
.toast-item.toast-danger { border-left-color: #d9534f; }
.toast-item.toast-warning { border-left-color: #e0a52b; }
.toast-item.toast-info { border-left-color: var(--wed-accent); }

.toast-close {
    margin-left: auto;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: .5;
}
.toast-close:hover { opacity: 1; }

@keyframes wed-toast-in {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Empty states ---- */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--wed-text);
}
.empty-state i {
    font-size: 3rem;
    color: var(--wed-accent);
    margin-bottom: 1rem;
    display: inline-block;
}
.empty-state h5 {
    font-weight: 700;
    margin-bottom: .4rem;
}
.empty-state p {
    opacity: .7;
    max-width: 420px;
    margin: 0 auto 1.25rem;
}

/* ---- Skeleton loaders ---- */
.skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.1) 37%, rgba(0,0,0,.06) 63%);
    background-size: 400% 100%;
    animation: wed-skeleton 1.4s ease infinite;
    border-radius: .6rem;
}
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 37%, rgba(255,255,255,.06) 63%);
    background-size: 400% 100%;
}
@keyframes wed-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---- Badges / status pills ---- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .75rem;
    border-radius: var(--wed-radius-badge);
    font-size: .78rem;
    font-weight: 600;
    background: color-mix(in srgb, currentColor 12%, transparent);
    line-height: 1.3;
}
.status-pill.dot::before {
    content: '';
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Theme toggle floating button ---- */
.theme-toggle-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--wed-primary);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: var(--wed-shadow-lg);
    z-index: 1500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}
.theme-toggle-btn:hover { transform: scale(1.08); }

/* ---- Pagination ---- */
.pagination-wed .page-link {
    border-radius: .6rem;
    margin: 0 .15rem;
    border: none;
    color: var(--wed-text);
}
.pagination-wed .page-item.active .page-link {
    background-color: var(--wed-primary);
    color: #fff;
}

/* ---- Scrollbar polish ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--wed-primary) 40%, transparent); border-radius: 10px; }

/* ---- Kanban board ---- */
.wed-kanban-column {
    background-color: color-mix(in srgb, var(--wed-surface) 92%, black 3%);
    border-radius: 1rem;
    padding: .75rem;
    height: 100%;
}
.wed-kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    padding: .25rem .5rem .75rem;
}
.wed-kanban-dropzone {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    border-radius: .7rem;
    transition: background-color .15s ease;
    padding: .1rem;
}
.wed-kanban-dropzone.is-drop-target {
    background-color: color-mix(in srgb, var(--wed-primary) 12%, transparent);
    outline: 2px dashed color-mix(in srgb, var(--wed-primary) 40%, transparent);
}
.wed-kanban-card {
    background-color: var(--wed-surface, #fff);
    border-radius: var(--wed-radius-card);
    padding: .75rem .9rem;
    box-shadow: var(--wed-shadow-sm);
    cursor: grab;
}
.wed-kanban-card.is-dragging { opacity: .4; }
.wed-kanban-card-title {
    font-weight: 600;
    color: var(--wed-text);
    text-decoration: none;
    display: block;
}
.wed-kanban-card-title:hover { color: var(--wed-primary); }

/* ---- Permission matrix ---- */
.wed-permission-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: .85rem;
    color: var(--wed-text);
    opacity: .8;
}
.wed-legend-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    margin-right: .35rem;
    vertical-align: middle;
}
.wed-legend-inherit { background: #adb5bd; }
.wed-legend-grant { background: var(--wed-success, #2E9E6D); }
.wed-legend-revoke { background: #d9534f; }
.wed-permission-accordion .accordion-item {
    background: var(--wed-surface, #fff);
    border: none;
    border-radius: var(--wed-radius-card) !important;
    margin-bottom: .5rem;
    overflow: hidden;
    box-shadow: var(--wed-shadow-sm);
}
.wed-permission-accordion .accordion-button {
    background: var(--wed-surface, #fff);
    color: var(--wed-text);
    font-weight: 600;
    box-shadow: none;
}
.wed-permission-accordion .accordion-button:not(.collapsed) {
    background: color-mix(in srgb, var(--wed-primary) 8%, transparent);
    color: var(--wed-text);
}
.wed-permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--wed-text) 8%, transparent);
}
.wed-permission-row:last-child { border-bottom: none; }
.wed-permission-row-label { display: flex; flex-direction: column; }

/* ---- Venue floor plan designer ---- */
.wed-floorplan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.wed-floorplan-canvas {
    position: relative;
    width: 100%;
    min-height: 640px;
    overflow: auto;
    border-radius: 1rem;
    border: 1px dashed color-mix(in srgb, var(--wed-text) 20%, transparent);
    background-color: color-mix(in srgb, var(--wed-surface) 96%, black 2%);
    background-image:
        linear-gradient(color-mix(in srgb, var(--wed-text) 6%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--wed-text) 6%, transparent) 1px, transparent 1px);
    background-size: 20px 20px;
}
.wed-floorplan-element {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--wed-text);
    cursor: move;
    user-select: none;
    border: 2px solid color-mix(in srgb, var(--wed-primary) 55%, transparent);
    background-color: color-mix(in srgb, var(--wed-primary) 14%, white);
    box-shadow: var(--wed-shadow-sm);
    padding: .25rem;
    line-height: 1.15;
}
.wed-floorplan-element.is-dragging { opacity: .7; box-shadow: var(--wed-shadow-md); z-index: 50; }
.wed-floorplan-element--round_table { border-radius: 50%; }
.wed-floorplan-element--rect_table { border-radius: .4rem; }
.wed-floorplan-element--stage { border-radius: .3rem; background-color: color-mix(in srgb, #6c757d 25%, white); border-color: #6c757d; }
.wed-floorplan-element--dance_floor { border-radius: .3rem; background-color: color-mix(in srgb, var(--wed-accent, #F4D849) 30%, white); border-color: var(--wed-accent, #F4D849); border-style: dashed; }
.wed-floorplan-element--bar { border-radius: .5rem; background-color: color-mix(in srgb, #8B5E3C 20%, white); border-color: #8B5E3C; }
.wed-floorplan-element--entrance { border-radius: .3rem; background-color: color-mix(in srgb, #2E9E6D 20%, white); border-color: #2E9E6D; }
.wed-floorplan-element--dj_booth { border-radius: .3rem; background-color: color-mix(in srgb, #4B4E6D 20%, white); border-color: #4B4E6D; }
.wed-floorplan-element--restroom { border-radius: .3rem; background-color: color-mix(in srgb, #adb5bd 30%, white); border-color: #adb5bd; }
.wed-floorplan-element--custom { border-radius: .3rem; border-style: dotted; }
.wed-floorplan-element-toolbar {
    position: absolute;
    top: -14px;
    right: -10px;
    display: none;
    gap: .2rem;
}
.wed-floorplan-element:hover .wed-floorplan-element-toolbar { display: flex; }
.wed-floorplan-element-toolbar button {
    width: 22px;
    height: 22px;
    padding: 0;
    line-height: 1;
    font-size: .7rem;
    border-radius: 50%;
}
.wed-floorplan-element-seated {
    font-size: .68rem;
    font-weight: 500;
    opacity: .85;
}
::-webkit-scrollbar-track { background: transparent; }

/* ---- Notification bell + center ---- */
.wed-notif-btn { position: relative; }
.wed-notif-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    background: var(--wed-danger, #d9534f); color: #fff;
    font-size: .62rem; font-weight: 700; line-height: 1;
    border-radius: 999px; box-shadow: 0 0 0 2px var(--wed-navbar-bg, #fff);
}
.wed-notif-menu { width: 340px; max-width: 92vw; padding: 0; overflow: hidden; }
.wed-notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .7rem .9rem; border-bottom: 1px solid var(--bs-border-color, rgba(0,0,0,.08));
}
.wed-notif-readall {
    border: 0; background: none; padding: 0; cursor: pointer;
    color: var(--wed-primary); font-size: .78rem; font-weight: 600;
}
.wed-notif-list { max-height: 60vh; overflow-y: auto; }
.wed-notif-empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 28px 16px; color: var(--bs-secondary-color, #8a94a2); font-size: .85rem;
}
.wed-notif-empty i { font-size: 1.4rem; opacity: .6; }
.wed-notif-item, .wed-notif-row {
    display: flex; gap: 10px; align-items: flex-start;
    padding: .7rem .9rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--bs-border-color, rgba(0,0,0,.06));
    transition: background .12s ease;
}
.wed-notif-item:last-child { border-bottom: 0; }
.wed-notif-item:hover, .wed-notif-row:hover { background: color-mix(in srgb, var(--wed-primary) 7%, transparent); }
.wed-notif-item.is-unread, .wed-notif-row.is-unread { background: color-mix(in srgb, var(--wed-primary) 6%, transparent); }
.wed-notif-item.is-unread .wed-notif-title,
.wed-notif-row.is-unread .wed-notif-title { font-weight: 700; }
.wed-notif-icon {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--wed-primary) 12%, transparent);
    color: var(--wed-primary); font-size: .95rem;
}
.wed-notif-body, .wed-notif-row-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wed-notif-title { font-size: .85rem; line-height: 1.3; }
.wed-notif-text {
    font-size: .78rem; color: var(--bs-secondary-color, #6a7480); line-height: 1.35; margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wed-notif-time { font-size: .7rem; color: var(--bs-secondary-color, #9aa5b1); margin-top: 3px; }
.wed-notif-footer {
    display: block; text-align: center; padding: .6rem; text-decoration: none;
    color: var(--wed-primary); font-size: .8rem; font-weight: 600;
    border-top: 1px solid var(--bs-border-color, rgba(0,0,0,.08));
}
.wed-notif-footer:hover { background: color-mix(in srgb, var(--wed-primary) 7%, transparent); }

/* Full-page list */
.wed-notif-page-list .wed-notif-row { padding: .9rem 1.1rem; }
.wed-notif-row-time { flex: 0 0 auto; font-size: .72rem; color: var(--bs-secondary-color, #9aa5b1); white-space: nowrap; }
