/* ============================================================
   EBYS - Site CSS
   ============================================================ */

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body { margin: 0; overflow-x: hidden; }

/* ---- Sidebar ---- */
#sidebar {
    min-height: 100vh;
    width: 260px;
    background: linear-gradient(160deg, #003366 0%, #005580 100%);
    transition: width 0.25s ease;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

#sidebar.collapsed {
    width: 68px;
}

#sidebar.collapsed span,
#sidebar.collapsed .fs-5,
#sidebar.collapsed .text-white-50.small {
    display: none;
}

#sidebar .nav-link {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 2px;
    transition: background 0.15s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
}

.proxy-mode-banner,
.proxy-mode-banner .small,
.proxy-switch-item,
.proxy-switch-item small,
.proxy-switch-item span {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ---- Page content ---- */
#page-content-wrapper {
    min-height: 100vh;
    overflow-x: auto;
}

/* ---- Login page ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #003366 0%, #005580 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ---- Document create page ---- */
.doc-preview-pane {
    background: #f0f0f0;
    border-radius: 8px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
}

[data-bs-theme="dark"] .doc-preview-pane {
    background: #2d2d2d;
}

#pdfPreviewFrame {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: 4px;
    min-height: 76vh;
}

.doc-control-pane {
    min-height: 80vh;
}

/* ---- Cards ---- */
.card {
    border-radius: 12px;
}

/* ---- Tables ---- */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Signatory card ---- */
.signatory-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    background: var(--bs-body-bg);
}

.signatory-card:active { cursor: grabbing; }

.signatory-card .badge { font-size: 0.7rem; }

/* ---- Focus ring ---- */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 85, 128, 0.25);
}

.sidebar-brand-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
}

.login-brand-image {
  max-width: 180px;
  max-height: 90px;
  object-fit: contain;
}

.dashboard-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.agenda-list-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.agenda-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-note-chip {
    border-left: 4px solid var(--note-color);
    background: color-mix(in srgb, var(--note-color) 30%, white);
    padding: 0.85rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.calendar-day {
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    min-height: 160px;
    padding: 0.75rem;
    background: var(--bs-body-bg);
}

.calendar-day.is-muted {
    opacity: 0.6;
}

.calendar-day.is-selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.calendar-day-number {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.calendar-item-pill {
    display: block;
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.4rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    font-size: 0.82rem;
}

.calendar-item-pill.task {
    background: rgba(13, 110, 253, 0.09);
    border-color: rgba(13, 110, 253, 0.18);
}

.calendar-item-pill.note {
    background: rgba(255, 193, 7, 0.16);
    border-color: rgba(255, 193, 7, 0.25);
}

.calendar-item-pill.completed {
    text-decoration: line-through;
    opacity: 0.7;
}

.note-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.note-card {
    border-radius: 18px;
    padding: 1rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.note-card-actions {
    margin-top: auto;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    background: var(--bs-tertiary-bg);
}

@media (max-width: 991px) {
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}
