/* ========== Base layout ========== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #0f172a;
    color: #e5e7eb;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #020617, #0b1120);
    border-right: 1px solid #1f2937;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.logo-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: radial-gradient(circle, #22c55e, #16a34a);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.logo-text {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: auto;
}

.nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #9ca3af;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
    background-color: #111827;
    color: #e5e7eb;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #020617;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: 24px;
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ========== Main area ========== */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */

.topbar {
    height: 64px;
    border-bottom: 1px solid #1f2937;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 55%);
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background-color: #020617;
    border: 1px solid #1f2937;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Content */

.content {
    padding: 22px 26px 32px;
}

/* ========== Cards & Grid ========== */

.grid {
    display: grid;
    gap: 18px;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 960px) {
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* simple responsive hack for now */
    }
}

.card {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.2), rgba(15, 23, 42, 0.95));
    border-radius: 14px;
    padding: 16px 18px 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
}

.card-metric {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 6px 0 2px;
    color: #f9fafb;
}

.card-label {
    font-size: 0.9rem;
    color: #9ca3af;
}

.card-body {
    font-size: 0.9rem;
    color: #d1d5db;
}

.muted {
    color: #6b7280;
    font-size: 0.85rem;
}

/* ========== Buttons ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #020617;
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(34, 197, 94, 0.55);
}

.btn-secondary {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: #020617;
}

.btn-outline {
    background: transparent;
    border-color: #374151;
    color: #e5e7eb;
}

.btn-outline:hover {
    background: #111827;
}

.btn-full {
    width: 100%;
}

.buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== Spacing utils ========== */

.mt-lg {
    margin-top: 24px;
}

.messages {
    margin-bottom: 12px;
}
.alert {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 6px;
    background: rgba(55, 65, 81, 0.7);
}
.alert-success {
    background: rgba(34, 197, 94, 0.18);
}
.alert-error {
    background: rgba(239, 68, 68, 0.18);
}
 /* ===== WEEK CALENDAR LAYOUT (MATCH APP UI) ===== */

.calendar-grid-wrapper {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #020617; /* same vibe as dark cards */
}

/* Header row: empty time col + 7 days */
.calendar-grid-header-row-with-times {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: #020617;
}

.calendar-time-header {
    border-right: 1px solid rgba(148, 163, 184, 0.35);
}

.calendar-day-header {
    padding: 6px 4px;
    text-align: center;
    border-right: 1px solid rgba(30, 41, 59, 0.8);
    font-size: 0.8rem;
    color: #e5e7eb;
}

.week-day-name {
    display: block;
    font-weight: 600;
}

.week-day-date {
    display: block;
    opacity: 0.7;
    font-size: 0.75rem;
}

/* Main grid: time column + 7 day columns */
.calendar-grid-with-times {
    display: grid;
    grid-template-columns: 80px 1fr;
    min-height: 420px;
}

/* Time column on the left */
.calendar-time-column {
    border-right: 1px solid rgba(30, 41, 59, 0.8);
    background: #020617;
}

.calendar-time-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.calendar-time-label {
    height: calc(100% / 16); /* 16 segments for 5am–9pm style */
    padding-left: 6px;
    padding-top: 4px;
    font-size: 0.75rem;
    opacity: 0.65;
    color: #9ca3af;
    border-bottom: 1px solid rgba(15, 23, 42, 1);
}

/* Right side: 7 day grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* One column per day */
.calendar-day-column {
    border-right: 1px solid rgba(30, 41, 59, 0.8);
    position: relative;
}

.calendar-day-body {
    position: relative;
    min-height: 420px;
    background-color: #020617;
    background-image: linear-gradient(
        to bottom,
        rgba(51, 65, 85, 0.4) 1px,
        transparent 1px
    );
    background-repeat: repeat-y;
}

/* Shift blocks */
.calendar-shift-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 7px;
    padding: 4px 6px;
    font-size: 0.75rem;
    line-height: 1.1rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.45);
}

.calendar-shift-block:hover {
    background: rgba(15, 23, 42, 1);
    border-color: rgba(129, 140, 248, 0.9); /* subtle indigo highlight on hover */
}

.calendar-shift-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-shift-meta {
    opacity: 0.9;
}

.calendar-shift-location {
    opacity: 0.75;
    font-size: 0.7rem;
}
/* ===== Weekly calendar shift stacking ===== */

.calendar-day-body {
    position: relative;
}

/* Base shift block – make sure they stack with a visible edge */
.calendar-shift-block {
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    border-radius: 4px;
    border-left: 3px solid #2563eb; /* emphasise left edge */
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

/* When there are multiple shifts in a day, stagger them slightly horizontally.
   This doesn't affect the time positioning, just the left edge. */
.calendar-day-body .calendar-shift-block:nth-child(2) {
    transform: translateX(4px);
}
.calendar-day-body .calendar-shift-block:nth-child(3) {
    transform: translateX(8px);
}
.calendar-day-body .calendar-shift-block:nth-child(4) {
    transform: translateX(12px);
}
.calendar-day-body .calendar-shift-block:nth-child(5) {
    transform: translateX(16px);
}

/* You can add more nth-child rules if a business ever has >5 shifts in one day */

/* ===== Day header shift-count badge ===== */

.week-day-header-main {
    display: flex;
    flex-direction: column;
}

.week-day-header-meta {
    margin-top: 4px;
}

.week-day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #1d4ed8;
    color: #ffffff;
}
