/* Duyuru composer.
   Lives in its own file rather than app.css, which App.razor does not link — MudBlazor replaced
   the Blazor template stylesheet, and linking it now would drag unrelated legacy rules onto every
   page. */

.fm-rich-editor .ql-container {
    /* Operators write multi-paragraph duyurular; a one- or two-line box makes that miserable. */
    min-height: 280px;
    max-height: 520px;
    overflow-y: auto;
    font-family: inherit;
    font-size: 0.95rem;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.fm-rich-editor .ql-editor {
    min-height: 280px;
    line-height: 1.6;
}

.fm-rich-editor .ql-toolbar {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
}

/* Quill's placeholder is styled as body text by default and reads like real content. */
.fm-rich-editor .ql-editor.ql-blank::before {
    font-style: normal;
    opacity: 0.55;
}

/* ── nova brand ──────────────────────────────────────────────────────────── */

.nova-logo {
    height: 34px;
    width: 34px;
    /* Inherits the app-bar text colour via currentColor inside the SVG, so one asset serves
       both themes. */
    color: inherit;
    display: block;
}

/* Lowercase "nova" is the mark, so it carries the weight and the rest of the title recedes. */
.nova-wordmark {
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    font-size: 2.15rem;
    /* line-height 1 still leaves the font's internal ascent above the glyph, so the visible top
       of the "n" sat below the logo. A lowercase n has no ascender — its top is the x-height —
       so the block is pulled up by the gap between cap-height and x-height to make the two
       silhouettes start on the same pixel. */
    line-height: 0.72;
    display: inline-block;
    position: relative;
    top: 1px;
}

.nova-lockup {
    display: inline-flex;
    /* Tops aligned, not centres — the whole point is that the n and the mark start together. */
    align-items: flex-start;
    gap: 9px;
}

/* Two short words stacked: at this size they read as one unit beside the name instead of
   trailing off as a sentence. */
.nova-descriptor {
    display: inline-flex;
    flex-direction: column;
    padding-top: 3px;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: .01em;
    opacity: .88;
}

/* iOS-style segmented theme control in the app bar. MudToggleGroup ships with a bordered,
   full-height look that fights the bar, so it is slimmed into a pill. */
.nova-theme-toggle {
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .14);
    border: none !important;
    padding: 2px;
    margin-right: 8px;
}
.nova-theme-toggle .mud-toggle-item {
    border: none !important;
    border-radius: 999px !important;
    padding: 3px 12px !important;
    color: inherit;
    text-transform: none;
}

/* Icon and word on one line. The words are the point — three unlabelled icons in a bar were
   unreadable to anyone who had not been told what they meant. */
.nova-theme-seg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}
.nova-theme-label {
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Below tablet the app bar has no room for three words; the icons carry it and the tooltips
   remain. */
@media (max-width: 1100px) {
    .nova-theme-label { display: none; }
    .nova-theme-toggle .mud-toggle-item { padding: 3px 9px !important; }
}
.nova-theme-toggle .mud-toggle-item-selected {
    /* The app bar's own two colours, swapped. This pill sits ON the bar, so it has to read as a
       hole punched in it — and taking both from the bar keeps it legible whatever the bar is.
       A hardcoded white pill worked only while every scheme had a dark bar; a pale one (Sarı)
       would have put bright yellow text on white. */
    background: var(--mud-palette-appbar-text);
    color: var(--mud-palette-appbar-background);
}

/* MudBlazor draws a divider between toggle items. With the pill radius on each item it renders as
   a pair of crescents rather than a line, which reads as decoration nobody asked for. */
.nova-theme-toggle .mud-toggle-item-delimiter { display: none !important; }

/* ── Apsiyon-style header: brand block flush left, drawer-width ──────────── */
/* ── Brand block: top of the drawer, above the menu items ────────────────── */

.nova-brand {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 64px;              /* matches the app bar, so the two tops line up */
    padding: 0 16px;
    flex-shrink: 0;
    /* The APP BAR's text colour, not primary's. Primary's contrast text is whatever reads on a
       primary BUTTON, and in dark mode that is a near-black tint of the house colour — correct on
       a bright button, invisible on this dark block, which is how the wordmark and logo once
       disappeared. The logo SVG paints with currentColor, so it follows this line too. */
    color: var(--mud-palette-appbar-text);
    /* Follows the APP BAR, not the primary colour: the brand is the top-left corner of the same
       chrome the bar is, and the two are no longer the same value — the bar is a shade deeper
       than the buttons. Keyed to the bar, this corner stays a step deeper than both the bar and
       the menu through any theme change. */
    background-color: var(--mud-palette-appbar-background);
    background-image: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, .22));
}

/* Drawer sütununun düzeni (marka sabit, menü kaydırılır) nav.css'te — menüyle aynı dosyada
   durmalı, çünkü ikisi tek bir düzen. Buradaki eski hâli #213'e kadar .mud-drawer-content'e
   overflow:hidden veriyordu ve uçan paneli kırpıyordu; bu dosya nav.css'ten SONRA yüklendiği için
   de düzeltmeyi sessizce eziyordu. */

/* The bar starts where the drawer ends, so the brand is never covered. Only while the drawer is
   actually open — MudBlazor puts .mud-drawer-open on the layout root. */
@media (min-width: 960px) {
    .mud-drawer-open .nova-appbar {
        left: var(--mud-drawer-width-left, 240px);
        width: calc(100% - var(--mud-drawer-width-left, 240px));
    }
}

/* ── Global search, centered in the bar ──────────────────────────────────── */
.nova-search {
    max-width: 460px;
    width: 100%;
}
.nova-search .mud-input-outlined-border { border-color: rgba(255, 255, 255, .45) !important; }
.nova-search .mud-input { color: inherit !important; }
.nova-search .mud-icon-root { color: inherit; }
.nova-search input::placeholder { color: rgba(255, 255, 255, .75); opacity: 1; }

@media (max-width: 1000px) {
    /* Small screens: identity shrinks to the mark, search yields to the menu button. */
    .nova-search { display: none; }
}

/* Tables whose rows navigate: the pointer is the only affordance once the "Aç" link is gone. */
.nova-clickable-rows tbody tr { cursor: pointer; }

/* ── Page width containment ──────────────────────────────────────────────────
   Wide tables (Daireler, Kişiler, duyuru alıcıları) were pushing the whole page wider than the
   viewport, so the right-hand end of button rows and table columns fell off the screen with no
   scrollbar to reach them. Two rules fix it:
     1. the container may not exceed the space the drawer leaves it, and
     2. a table too wide for that scrolls inside its own box instead of stretching the page. */

/* Third rule, added for 4K: the page stops growing where reading stops being easy. Full-screen on
   a 2560px monitor stretched every table to the full width, which does nothing for a table and a
   great deal against it — "Blok" and "Daire" ended up a hand's width away from the site name they
   belong to, with two thousand pixels of empty address column in between. Left-aligned rather than
   centred, so the content stays anchored to the menu it was reached from. */
.mud-main-content .mud-container {
    max-width: min(100%, var(--nova-sayfa-genisligi, 1600px));
    margin-left: 0;
    margin-right: auto;
    overflow-x: hidden;
}

.mud-table-container {
    overflow-x: auto;
}

/* Long single-line values (adresler, e-postalar) must wrap rather than widen their column. */
.mud-table-cell {
    overflow-wrap: anywhere;
}

/* ── Statement column mapper ─────────────────────────────────────────────── */
/* The operator's own file, shown so columns can be mapped against real data rather than by
   counting columns in Excel and typing indices. */

.nova-map-scroll {
    overflow-x: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.nova-map-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: .82rem;
}

.nova-map-table th,
.nova-map-table td {
    border-right: 1px solid var(--mud-palette-table-lines);
    border-bottom: 1px solid var(--mud-palette-table-lines);
    padding: 4px 8px;
    text-align: left;
    /* Statement descriptions are long and a wrapped cell makes the grid unreadable as a grid;
       the container scrolls instead. */
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nova-map-table th {
    background-color: var(--mud-palette-background-gray);
    min-width: 170px;
    vertical-align: bottom;
}

/* Row numbers are the file's own 0-based indices — the same numbers the start-row stepper counts,
   so the operator can line the two up. */
.nova-map-table .nova-map-rownum {
    min-width: 0;
    width: 2.5rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Struck through rather than hidden: a skipped row must stay visible, or there is no way to tell
   the start row is set one too far and is eating real data. */
.nova-map-table .nova-map-skipped td {
    text-decoration: line-through;
    opacity: .45;
}

/* ── Drag-and-drop file panel ────────────────────────────────────────────── */
/* The <input type="file"> is stretched transparently across the panel, so the browser's native
   drop target IS the panel. That is why no JS interop is involved: dragging a file from Finder
   onto it raises the same change event as picking one, and a click still opens the picker. */

.nova-dropzone-wrap {
    position: relative;
}

.nova-dropzone-wrap .nova-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.nova-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    padding: 24px;
    text-align: center;
    border-style: dashed !important;
    border-width: 2px !important;
    transition: background-color .15s ease, border-color .15s ease;
}

.nova-dropzone-active {
    border-color: var(--mud-palette-primary) !important;
    background-color: var(--mud-palette-action-default-hover);
}

/* ── İşletme Defteri ─────────────────────────────────────────────────────── */
/* Laid out to match the sheet managers already know: two numbered columns side by side, gider left
   and gelir right, both in date order, with the carried-forward figure last. */

.nova-defter {
    background: #fff;
    color: #000;
    padding: 12px 14px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    /* Fixed white-on-black regardless of theme: this block is a printed document, and a dark-mode
       version of it would come out of the printer as a black rectangle. */
}

.nova-defter-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.nova-defter-site { font-size: 1rem; font-weight: 600; }
.nova-defter-title { font-size: .95rem; font-weight: 700; }
/* The house colour by variable, not by hex. This was hardcoded to the old teal and silently kept
   it when the palette changed — the one place in the app where that happened. */
.nova-defter-brand {
    font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em;
    color: var(--mud-palette-primary);
}

.nova-defter-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.nova-defter-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .62rem;
    line-height: 1.25;
}

.nova-defter-table th,
.nova-defter-table td {
    border: 1px solid #999;
    padding: 2px 4px;
    vertical-align: top;
    /* Descriptions are long and must wrap rather than widen the column — the sheet has to hold its
       two-column shape at print width. */
    overflow-wrap: anywhere;
}

.nova-defter-table th { background: #eee; font-weight: 600; text-align: left; }
.nova-defter-table .c-no { width: 2.2rem; text-align: right; }
.nova-defter-table .c-date { width: 4.6rem; white-space: nowrap; }
.nova-defter-table .c-amt { width: 5.4rem; text-align: right; white-space: nowrap; }
.nova-defter-table .nova-defter-total td { font-weight: 700; background: #f4f4f4; }
.nova-defter-table .nova-defter-devir td { font-weight: 600; }

.nova-defter-foot {
    display: flex;
    justify-content: space-between;
    font-size: .58rem;
    color: #444;
    margin-top: 6px;
}

/* Print: the page IS the document. Everything the app puts around it — drawer, app bar, filters —
   is screen furniture and must not reach the paper. */
@media print {
    .nova-noprint,
    .mud-drawer,
    .mud-appbar,
    .mud-overlay,
    .mud-snackbar-provider { display: none !important; }

    .mud-main-content,
    .mud-layout,
    body { padding: 0 !important; margin: 0 !important; background: #fff !important; }

    .nova-defter { border: none; padding: 0; }

    /* Landscape A4: two columns of statement descriptions do not fit across a portrait page without
       shrinking the text past readable. */
    @page { size: A4 landscape; margin: 8mm; }

    /* A long book runs to several sheets; the column headers have to repeat on each of them or the
       later pages are unreadable. */
    .nova-defter-table thead { display: table-header-group; }
    .nova-defter-table tr { break-inside: avoid; }
}

/* ── Özet Gelir–Gider Tablosu ────────────────────────────────────────────── */
/* One narrow column of labels and one of amounts — the two columns that matter — so the whole
   summary fits a single portrait sheet. */

.nova-ozet .nova-ozet-table { width: 100%; max-width: 720px; font-size: .72rem; }
.nova-ozet .nova-ozet-table td:last-child { width: 8rem; }

.nova-ozet-section td {
    background: #e8e8e8;
    font-weight: 700;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

/* An unclassified total is not a category — it is a gap, and it reads as one. */
.nova-ozet-warn td { background: #fff4e5; font-style: italic; }

@media print {
    /* Portrait here, unlike the defter: this table is two columns, not two tables side by side. */
    .nova-ozet ~ * { display: none !important; }
}

/* ── Detaylı Borç Listesi ────────────────────────────────────────────────── */
/* Many narrow numeric columns across one landscape sheet, pinned to the flat column so a resident
   can follow their own row across the page. */

.nova-borc .nova-defter-table { font-size: .58rem; }
.nova-borc .nova-defter-table .c-amt { width: 4.4rem; }
.nova-borc .nova-defter-table .c-date { width: 3.4rem; white-space: nowrap; }
.nova-borc .nova-defter-table td,
.nova-borc .nova-defter-table th { padding: 1px 3px; }

/* Alternating bands: the eye loses its row halfway across ten numeric columns otherwise. */
.nova-borc .nova-defter-table tbody tr:nth-child(even) td { background: #f6f6f6; }

/* The name column was the only one without a width, so it absorbed every spare pixel and pushed the
   figures to the far edge. Capped, and the table sizes to its content instead of being forced to
   the full page width. */
.nova-borc .nova-defter-table { width: auto; max-width: 100%; }
.nova-borc .nova-defter-table .c-name {
    width: 9rem;
    max-width: 9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Build stamp at the foot of the drawer. Quiet on purpose — it is there to be found when someone
   goes looking, not to compete with the menu above it. */
.nova-build {
    padding: 10px 16px 14px;
    font-size: .7rem;
    line-height: 1.3;
    opacity: .55;
    word-break: break-all;
}

/* A date must never wrap. "31.08.2026" broken across two lines reads as two numbers, and the row
   grows a second line for four characters. Used on every date column in a dense table. */
.nova-nowrap { white-space: nowrap; }


/* A deleted movement. Struck through and faded, because the row is being shown for one reason
   only — so an operator can see that something was removed and read what it said. It is not part
   of the statement: it carries no balance, is not clickable, and never reaches an export.
   line-through on the row rather than on each cell, so the strike runs across the whole line the
   way a pen would. */
.nova-silinen td {
    text-decoration: line-through;
    opacity: .5;
}

/* The month grid. Seven columns, six rows — a fixed six so the page does not jump a row's height
   when the month starts on a Sunday. */
.nova-cal {
    display: grid;
    /* A narrow week-number column, then the seven days. Matching Google's layout is the point:
       people quote week numbers to each other and then look for them here. */
    grid-template-columns: 2.2rem repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--mud-palette-lines-default);
    border: 1px solid var(--mud-palette-lines-default);
}
.nova-cal-head {
    background: var(--mud-palette-background-grey);
    padding: 4px 6px;
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
}
.nova-cal-day {
    background: var(--mud-palette-surface);
    /* Six events deep. The old 5.5rem fitted four, which is fine until the week somebody actually
       needs to read is the one that overflows — and a month view that hides the busy days is
       worse than useless, because it looks complete. */
    min-height: 8.5rem;
    padding: 2px 4px 5px;
    cursor: pointer;
}
.nova-cal-day:hover { background: var(--mud-palette-action-default-hover); }
/* Days from the neighbouring months are kept rather than blanked — a meeting on the 31st is still
   a meeting when you are looking at the next month — but they recede. */
.nova-cal-other { opacity: .45; }
/* Today is a filled circle on the date, the way every calendar marks it, rather than an outline
   around the whole cell — an outlined cell reads as "selected", which it is not. */
.nova-cal-num {
    font-size: .75rem;
    opacity: .75;
    text-align: center;
    margin: 2px 0 3px;
    line-height: 1.4rem;
}
.nova-cal-today .nova-cal-num {
    display: block;
    width: 1.4rem;
    margin: 2px auto 3px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    opacity: 1;
    font-weight: 600;
}
.nova-cal-ev {
    display: block;
    width: 100%;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: .72rem;
    line-height: 1.25;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nova-cal-k1 { background: var(--mud-palette-tertiary); color: var(--mud-palette-tertiary-text); }
.nova-cal-k2 { background: var(--mud-palette-info); color: var(--mud-palette-info-text); }
.nova-cal-k3 { background: var(--mud-palette-secondary); color: var(--mud-palette-secondary-text); }
.nova-cal-k4 { background: var(--mud-palette-warning); color: var(--mud-palette-warning-text); }
.nova-cal-k9 { background: var(--mud-palette-background-grey); color: var(--mud-palette-text-primary); }
/* The notice deadline is an obligation, not an appointment, so it is outlined rather than filled —
   it should read as a marker on the day, not as another thing to attend. */
.nova-cal-deadline {
    background: transparent;
    color: var(--mud-palette-error);
    border: 1px dashed var(--mud-palette-error);
    font-weight: 600;
}

/* An event from the operator's own Google Calendar. Outlined rather than filled, and in the
   neutral tone: it is context for the firm's events, not one of them — and nothing here can be
   edited from this screen, so it should not look like it can. */
.nova-cal-google {
    background: transparent;
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
    text-decoration: none;
}
.nova-cal-google:hover { border-color: var(--mud-palette-text-secondary); }

/* Google's own colours, carried through. A timed event gets a dot and plain text; an all-day one is
   filled — the way Google itself draws them, so a month reads the same in both places. */
.nova-cal-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    flex: none;
}
.nova-cal-google-allday {
    color: #fff;
    border-style: solid;
}

/* The ISO week number down the left edge. Muted — it is a reference, not content. */
.nova-cal-week {
    background: var(--mud-palette-background-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: var(--mud-palette-text-secondary);
}
