/* ============================
   Global styles & design tokens
   ============================ */

:root {
    --bg-body: #020617;          /* fondo general */
    --bg-surface: #020617;       /* surface / cards */
    --bg-surface-alt: #020617;

    --border-subtle: #1f2933;
    --border-strong: #4b5563;

    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;

    --accent: #0ea5e9;           /* cyan */
    --accent-soft: rgba(14, 165, 233, 0.12);
    --accent-strong: #0284c7;

    --danger: #f97373;
    --danger-soft: rgba(248, 113, 113, 0.12);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.35);

    --font-base: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
}

/* Navegadores viejos de golpe no respetan :root -> mejor asegurar body también */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    color-scheme: dark;
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-base);
    background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    background-attachment: fixed;
}

/* Themed scrollbars so the reserved gutter matches the dark UI */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 rgba(15, 23, 42, 0.65);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.65);
    border-radius: 12px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0ea5e9, #6366f1);
    border-radius: 12px;
    border: 2px solid rgba(15, 23, 42, 0.65);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22d3ee, #818cf8);
}

/* ============================
   App shell
   ============================ */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-logo {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #e5e7eb;
}

/* Nav */

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.app-nav-left,
.app-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: none;
    color: #e5e7eb;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-active .nav-dropdown-trigger {
    background-color: #020617;
    border-color: #1f2933;
    color: #f9fafb;
    transform: translateY(-1px);
}

.nav-dropdown-caret {
    font-size: 0.8rem;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    background: #0b1223;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    min-width: 240px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    padding: 0.65rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu-wide {
    min-width: 520px;
}

.nav-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-dropdown-link:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

.nav-dropdown-link-active {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.4), transparent 55%), radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.55), transparent 60%), #020617;
    color: #f9fafb;
    border: 1px solid #1f2933;
}

.nav-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.nav-panel-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-panel-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a5b4fc;
    padding: 0.2rem 0.35rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid transparent;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease;
}

/* Hover color */
.nav-link:hover {
    background-color: #020617;   /* slightly lighter than header */
    border-color: #1f2933;
    color: #f9fafb;
    transform: translateY(-1px);
}

/* Active section color (current page) */
.nav-link-active {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.4), transparent 55%),
                radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.55), transparent 60%),
                #020617;
    color: #f9fafb;
    border-color: #1f2933;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9),
                0 6px 14px rgba(15, 23, 42, 0.5);
}

/* Optional: divider between user and admin nav */
.nav-divider {
    width: 1px;
    height: 1.5rem;
    background: linear-gradient(to bottom, transparent, #4b5563, transparent);
    margin: 0 0.5rem;
}

.app-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    transition: all 0.15s ease-out;
}

.app-nav a:hover {
    color: #e5e7eb;
    background-color: rgba(148, 163, 184, 0.15);
}

.app-nav a.active {
    color: #e5e7eb;
    background-color: var(--accent-soft);
    border: 1px solid rgba(56, 189, 248, 0.5);
}

.app-nav span {
    color: var(--text-soft);
    font-size: 0.8rem;
}

.nav-logout-form {
    margin: 0;
}

.nav-lang-form {
    margin: 0;
}

.nav-lang-button {
    position: relative;
    width: 58px;
    height: 38px;
    border: 1px solid rgba(14, 165, 233, 0.45);
    border-radius: 12px;
    background: linear-gradient(150deg, rgba(14, 165, 233, 0.18), rgba(99, 102, 241, 0.22));
    color: #e0f2fe;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 14px rgba(14, 165, 233, 0.18);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.2s ease,
                background 0.25s ease, filter 0.25s ease;
}

.nav-lang-button:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(14, 165, 233, 0.8);
    background: linear-gradient(155deg, rgba(34, 211, 238, 0.25), rgba(99, 102, 241, 0.32));
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35), 0 14px 28px rgba(0, 0, 0, 0.35);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}

.nav-lang-button:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.95);
    outline-offset: 3px;
}

.lang-label {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.lang-current {
    opacity: 1;
}

.lang-next {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
}

.nav-lang-button:hover .lang-current,
.nav-lang-button:focus-visible .lang-current {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
}

.nav-lang-button:hover .lang-next,
.nav-lang-button:focus-visible .lang-next {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav-logout-button {
    position: relative;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(248, 113, 113, 0.2), transparent 55%),
                linear-gradient(140deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
    color: #fca5a5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.2s ease,
                background 0.25s ease, filter 0.25s ease;
    overflow: visible;
}

.nav-logout-button:hover {
    transform: translateY(-1px) scale(1.03);
    border-color: rgba(248, 113, 113, 0.6);
    background: radial-gradient(circle at 30% 30%, rgba(248, 113, 113, 0.25), transparent 60%),
                linear-gradient(150deg, rgba(30, 41, 59, 0.98), rgba(30, 41, 59, 0.85));
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.45), 0 14px 28px rgba(0, 0, 0, 0.35);
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.35));
}

.nav-logout-button:focus-visible {
    outline: 2px solid rgba(248, 113, 113, 0.9);
    outline-offset: 3px;
}

.logout-icon svg {
    width: 18px;
    height: 18px;
}

.logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.logout-icon svg {
    display: block;
}

.logout-label {
    position: absolute;
    left: 115%;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: rgba(15, 23, 42, 0.98);
    color: #f8fafc;
    border: 1px solid rgba(248, 113, 113, 0.5);
    border-radius: 10px;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.nav-logout-button:hover .logout-label,
.nav-logout-button:focus-visible .logout-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.35));
}

/* Layout main & footer */

.app-main {
    flex: 1;
    min-height: 0; /* allow overflow scrolling within the flex parent */
    padding: 1.5rem 1rem 2rem;
    overflow: auto;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Footer */

.app-footer {
    font-size: 0.8rem;
    color: var(--text-soft);
    text-align: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.95);
}


.app-footer .footer-link {
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-weight: 500;
  opacity: 0.9;
}

.app-footer .footer-link:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.app-footer .footer-sep {
  opacity: 0.5;
}

/* --- Legal pages (Privacy/Cookies) --- */
/* If you wrap the policy content (next step), these help unify visuals */
.legal-policy a,
.legal-policy [data-custom-class="link"],
.legal-policy [data-custom-class="link"] * {
  text-decoration: none !important;
}

/* ============================
   Typography helpers
   ============================ */

.page-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 0.15rem;
}

.page-subtitle {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================
   Cards
   ============================ */

.card {
    background: radial-gradient(circle at top left,
                rgba(148, 163, 184, 0.12),
                rgba(15, 23, 42, 0.85)),
                #020617;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
    padding: 1rem 1rem 1.1rem;
    margin-bottom: 1rem;
}

.summary-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.summary-card-meta {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.card-narrow {
    max-width: 620px;
    margin: 1rem auto 0;
}

.card-left {
    margin-left: 0;
    margin-right: auto;
}


/* ============================
   Buttons
   ============================ */

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: transform 0.12s ease-out, box-shadow 0.18s ease-out,
                background 0.25s ease-out, color 0.2s ease-out,
                filter 0.25s ease-out;
    font-weight: 600;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #0b1120;
    box-shadow: 0 10px 22px rgba(8, 47, 73, 0.65);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(8, 47, 73, 0.9);
}

.btn-cta {
    background: linear-gradient(130deg, #22d3ee 0%, #6366f1 50%, #a855f7 100%);
    color: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.45);
    filter: saturate(1.05);
}

.btn-cta:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 16px 36px rgba(99, 102, 241, 0.6);
    filter: brightness(1.02);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-1px);
}

.btn-clock {
    position: relative;
    overflow: hidden;
    color: #0b1120;
    background: linear-gradient(120deg, #22c55e, #0ea5e9);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
    animation: clockPulse 3.4s ease-in-out infinite;
}

.btn-clock::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.btn-clock:hover::after {
    opacity: 0.18;
}

.btn-clock:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.55);
}

.btn-clock.is-clocked-in {
    background: linear-gradient(120deg, #fb923c, #ef4444);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
    animation: clockPulseWarm 3.4s ease-in-out infinite;
}

@keyframes clockPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
    100% { filter: brightness(1); }
}

@keyframes clockPulseWarm {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
    100% { filter: brightness(1); }
}

/* Por si sigues usando el inline class="btn btn-sm btn-secondary" en el logout */
button.btn,
input[type="submit"].btn {
    font-family: var(--font-base);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.65;
    cursor: not-allowed;
    filter: grayscale(0.2);
    transform: none;
    box-shadow: none;
}

.clock-card {
    margin-bottom: 1.5rem;
}

.clock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.clock-copy {
    flex: 1;
    margin: 0;
    min-width: 220px;
}

.clock-action {
    display: flex;
    align-items: center;
}

@media (max-width: 640px) {
    .clock-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .clock-action {
        width: 100%;
    }
}

/* ============================
   Forms
   ============================ */

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.form-actions {
    margin-top: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-base);
    font-size: 0.9rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.form-textarea {
    resize: vertical;
}

/* Para inputs por defecto si tienen sólo estilos inline de antes */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    font-family: var(--font-base);
    font-size: 0.9rem;
}

/* ============================
   Tables
   ============================ */

.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table thead {
    background: rgba(15, 23, 42, 0.95);
}

.table th,
.table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.9);
    text-align: left;
    vertical-align: top;
}

.table th {
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.6);
}

.table tbody tr:hover {
    background-color: rgba(30, 64, 175, 0.15);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.pagination-button.is-disabled {
    pointer-events: none;
    opacity: 0.6;
    cursor: default;
}

.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.page-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.7);
    transition: transform 0.12s ease, border-color 0.15s ease, color 0.15s ease;
    font-weight: 600;
}

.page-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.6);
    color: #e5e7eb;
}

.page-chip-active {
    border-color: rgba(56, 189, 248, 0.8);
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.3), transparent 55%),
                radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.35), transparent 60%),
                #0f172a;
    color: #f8fafc;
}

/* ============================
   Flash messages
   ============================ */

.flash {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.flash-error {
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fecaca;
}

.flash-success {
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.8);
    color: #bbf7d0;
}

.flash-info {
    background: var(--accent-soft);
    border: 1px solid rgba(56, 189, 248, 0.8);
    color: #e0f2fe;
}

/* ============================
   Misc helpers
   ============================ */

.text-muted {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--text-muted);
}

.chip-today {
    color: #f0f9ff;
    border-color: rgba(14, 165, 233, 0.8);
    background: rgba(14, 165, 233, 0.12);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================
   Status & priority chips
   ============================ */

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text-muted);
    text-transform: uppercase;
}

.status-todo {
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
}

.status-in-progress {
    border-color: rgba(14, 165, 233, 0.6);
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.12);
}

.status-done {
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.14);
}

.status-cancelled {
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
    background: rgba(248, 113, 113, 0.14);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid transparent;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.status-dot.status-todo {
    background: rgba(148, 163, 184, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.status-dot.status-in-progress {
    background: rgba(250, 204, 21, 0.95);
    border-color: rgba(234, 179, 8, 0.9);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.24);
}

.status-dot.status-done {
    background: rgba(34, 197, 94, 0.95);
    border-color: rgba(34, 197, 94, 0.85);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.24);
}

.status-dot.status-cancelled {
    background: rgba(249, 115, 22, 0.95);
    border-color: rgba(234, 88, 12, 0.85);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.24);
}

/* Legacy aliases used across templates */
.status-approved {
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.14);
}

.status-rejected,
.status-cancelled {
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
    background: rgba(248, 113, 113, 0.14);
}

.status-requested,
.status-in-progress {
    border-color: rgba(14, 165, 233, 0.6);
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.12);
}

.priority-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
}

.priority-low {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.5);
    color: #bbf7d0;
}

.priority-medium {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.55);
    color: #bae6fd;
}

.priority-high {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

/* ============================
   Calendar view
   ============================ */

.calendar-card {
    padding: 1.05rem;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.calendar-month-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-month-label {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.calendar-month-subtitle {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.calendar-filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.calendar-filters .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
}

.calendar-filter-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.calendar-cell {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 0.7rem;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.2s ease, transform 0.12s ease;
}

.calendar-cell:hover {
    border-color: rgba(56, 189, 248, 0.55);
    transform: translateY(-1px);
}

.calendar-cell-muted {
    opacity: 0.6;
}

.calendar-cell-today {
    border-color: rgba(14, 165, 233, 0.9);
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.12);
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.16), transparent 40%),
                rgba(15, 23, 42, 0.8);
}

.calendar-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 1rem;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.calendar-event {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.2);
    word-break: break-word;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.25rem;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.priority-high .event-dot,
.event-dot.priority-high {
    background: #f97373;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}

.priority-medium .event-dot,
.event-dot.priority-medium {
    background: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.16);
}

.priority-low .event-dot,
.event-dot.priority-low {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.calendar-event-body {
    min-width: 0;
}

.calendar-event-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.calendar-assignee {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.calendar-time {
    color: #e0f2fe;
    font-weight: 600;
}

.calendar-empty {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.link-button {
    background: none;
    border: none;
    color: #7dd3fc;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.day-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

.day-modal[hidden] {
    display: none;
}

.day-modal-dialog {
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.14), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-lg);
    padding: 1rem;
    width: min(90vw, 720px);
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.day-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.day-modal-label {
    color: var(--text-soft);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.day-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.day-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.day-modal-item {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.day-modal-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.day-modal-item-title {
    font-weight: 700;
    font-size: 1rem;
}

.day-modal-item-meta {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.day-modal-item-desc {
    color: var(--text-main);
    font-size: 0.92rem;
    white-space: pre-wrap;
    margin-bottom: 0.5rem;
}

.day-modal-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.status-inline-label {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.form-select-compact {
    padding: 0.25rem 0.5rem;
    min-width: 140px;
}

/* Responsive tweaks */

@media (max-width: 768px) {
    .app-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .app-main {
        padding: 1rem 0.75rem 1.5rem;
    }

    .card {
        padding: 0.85rem 0.8rem 0.95rem;
    }

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

    .calendar-card {
        padding: 0.85rem;
    }
}

.app-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #e5e7eb;
}

.app-logo-icon {
    height: 28px;     /* tweak as you like */
    width: auto;
    border-radius: 6px; /* or 0 if you prefer sharp */
}

/* ============================
   Login page
   ============================ */


.login-page {
    min-height: calc(100vh - 140px); /* header + footer area */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    max-width: 980px;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
    gap: 2.5rem;
    align-items: stretch;
}

/* Left panel with logo + tilt */
.login-visual {
    position: relative;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.4), transparent 55%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.55), transparent 60%),
        #020617;
    border: 1px solid rgba(148, 163, 184, 0.5);
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    transition:
        transform 180ms ease-out,
        box-shadow 180ms ease-out,
        border-color 180ms ease-out;
    box-shadow: 0 25px 50px -15px rgba(15, 23, 42, 0.85);
}

.login-logo {
    display: block;
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

.login-brand {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.login-tagline {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-soft);
}

/* Right side: bigger form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-form .form-field,
.login-form .form-row {
    width: 100%;
}

.login-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.login-actions .btn {
    min-width: 140px;
}

/* Stack on smaller screens */
@media (max-width: 900px) {
    .login-card {
        max-width: 640px;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }

    .login-visual {
        order: -1;
        text-align: center;
    }

    .login-logo {
        margin-left: auto;
        margin-right: auto;
    }

    .login-actions {
        justify-content: stretch;
    }

    .login-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================
   Error pages
   ============================ */

.error-page {
    min-height: calc(100vh - 140px); /* header + footer area */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.error-card {
    text-align: center;
    padding: 2.25rem 2rem 2.5rem;
}

.error-code {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-title {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.error-text {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: var(--text-soft);
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 640px) {
    .error-card {
        padding: 1.75rem 1.4rem 2rem;
    }

    .error-code {
        font-size: 3rem;
    }
}

/* --- Links: clickable but not underlined (global) --- */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Accessible focus without underline */
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 8px;
}
