/* ─────────────────────────────────────────────────────────────
   Zatelital Labs — Design System
   Alineado visualmente con Zatelital OS
   ───────────────────────────────────────────────────────────── */

/* ─── Font Faces (local) ─────────────────────────────────── */
@font-face {
    font-family: 'Alliance';
    src: url('../fonts/Alliance-PlattSemiBold.woff2') format('woff2'),
         url('../fonts/Alliance-PlattSemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'),
         url('../fonts/IBMPlexSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inconsolata';
    src: url('../fonts/Inconsolata-SemiExpandedSemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ─── Root Variables ─────────────────────────────────────── */
:root {
    --color-primary: #161616;
    --color-background: #fafafa;
    --color-muted: #b7b7b7;
    --color-border: rgba(22, 22, 22, 0.1);
    --color-hover: rgba(22, 22, 22, 0.05);
    --font-alliance: 'Alliance', 'SF Pro Display', system-ui, sans-serif;
    --font-ibm: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'Inconsolata', monospace;
}

/* ─── Reset ──────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Base ───────────────────────────────────────────────── */
body {
    font-family: var(--font-ibm);
    background-color: var(--color-background);
    color: var(--color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}

/* ─── Custom Font Classes ────────────────────────────────── */
.font-alliance {
    font-family: var(--font-alliance);
}

.font-ibm {
    font-family: var(--font-ibm);
}

.font-mono {
    font-family: var(--font-mono);
}

/* ─── Material Icons Sizing ──────────────────────────────── */
.material-icons-outlined {
    font-size: inherit;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

/* ─── Transition Utilities ───────────────────────────────── */
.transition-colors {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.transition-all {
    transition: all 0.15s ease;
}

.transition-transform {
    transition: transform 0.15s ease;
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-overlay {
    animation: fadeIn 0.2s ease;
}

.modal-content {
    animation: slideIn 0.2s ease;
}

/* ─── Hide Scrollbar Utility ─────────────────────────────── */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ─── Progress Bar ───────────────────────────────────────── */
.progress-bar {
    transition: width 0.5s ease;
}

/* ─── Input Focus ────────────────────────────────────────── */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary) !important;
}

/* ─── Button States ──────────────────────────────────────── */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Table Row Hover ────────────────────────────────────── */
.table-row:hover {
    background-color: var(--color-hover);
}

/* ─── Card Hover ─────────────────────────────────────────── */
.card-hover:hover {
    border-color: rgba(22, 22, 22, 0.3);
}

/* ─── Badge Styles ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Status Colors ──────────────────────────────────────── */
.status-active   { background-color: rgba(34, 197, 94, 0.1); color: rgb(22, 163, 74); }
.status-review   { background-color: rgba(234, 179, 8, 0.1); color: rgb(202, 138, 4); }
.status-completed{ background-color: rgba(34, 197, 94, 0.1); color: rgb(22, 163, 74); }
.status-pending  { background-color: rgba(234, 179, 8, 0.1); color: rgb(202, 138, 4); }
.status-overdue  { background-color: rgba(239, 68, 68, 0.1); color: rgb(220, 38, 38); }
.status-paid     { background-color: rgba(34, 197, 94, 0.1); color: rgb(22, 163, 74); }

/* ─── Priority Colors ────────────────────────────────────── */
.priority-high   { color: rgb(220, 38, 38); }
.priority-medium { color: rgb(202, 138, 4); }
.priority-low    { color: rgb(22, 163, 74); }

/* ─── Toast Notifications ────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-family: var(--font-ibm);
    font-size: 14px;
    color: var(--color-primary);
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    max-width: 360px;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-icon .material-icons-outlined {
    font-size: 16px;
    color: #ffffff;
}

.toast-message { flex: 1; line-height: 1.4; }

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-muted);
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover { color: var(--color-primary); }

.toast.toast-success .toast-icon { background-color: #22c55e; }
.toast.toast-error   .toast-icon { background-color: #ef4444; }
.toast.toast-warning .toast-icon { background-color: #f59e0b; }
.toast.toast-info    .toast-icon { background-color: #3b82f6; }

@keyframes toastSlideIn {
    0%   { opacity: 0; transform: translateX(100%); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    0%   { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

/* ─── Search Trigger Kbd ─────────────────────────────────── */
.zl-search-trigger-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    background: rgba(22, 22, 22, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

/* ─── FullCalendar Overrides ─────────────────────────────── */

/* Root calendar container */
.fc {
    font-family: var(--font-ibm);
    font-size: 14px;
}

/* Toolbar (header with navigation) */
.fc .fc-toolbar {
    margin-bottom: 1.5em !important;
}

.fc .fc-toolbar-title {
    font-family: var(--font-alliance) !important;
    font-size: 18px !important;
    text-transform: capitalize;
    color: var(--color-primary);
}

/* Navigation and view buttons */
.fc .fc-button {
    font-family: var(--font-ibm) !important;
    font-size: 13px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(22, 22, 22, 0.1) !important;
    background: white !important;
    color: var(--color-primary) !important;
    box-shadow: none !important;
    text-transform: none !important;
    font-weight: 400 !important;
    transition: all 0.15s ease;
}

.fc .fc-button:hover {
    background: rgba(22, 22, 22, 0.05) !important;
    border-color: rgba(22, 22, 22, 0.2) !important;
}

.fc .fc-button-active,
.fc .fc-button:active {
    background: var(--color-primary) !important;
    color: white !important;
    border-color: var(--color-primary) !important;
}

.fc .fc-button:focus {
    box-shadow: none !important;
}

.fc .fc-button-group > .fc-button {
    border-radius: 0 !important;
}

.fc .fc-button-group > .fc-button:first-child {
    border-radius: 6px 0 0 6px !important;
}

.fc .fc-button-group > .fc-button:last-child {
    border-radius: 0 6px 6px 0 !important;
}

/* Prev/Next arrows */
.fc .fc-prev-button,
.fc .fc-next-button {
    padding: 6px 10px !important;
}

/* Today button */
.fc .fc-today-button {
    text-transform: capitalize !important;
}

.fc .fc-today-button:disabled {
    opacity: 0.4 !important;
}

/* Day headers (Mon, Tue, etc) */
.fc .fc-col-header-cell {
    padding: 10px 0 !important;
    background: transparent !important;
    border-color: rgba(22, 22, 22, 0.1) !important;
}

.fc .fc-col-header-cell-cushion {
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--color-muted) !important;
    text-decoration: none !important;
}

/* Day cells */
.fc .fc-daygrid-day {
    border-color: rgba(22, 22, 22, 0.06) !important;
    transition: background-color 0.15s ease;
}

.fc .fc-daygrid-day:hover {
    background: rgba(22, 22, 22, 0.015) !important;
}

.fc .fc-daygrid-day-number {
    font-family: var(--font-ibm) !important;
    font-size: 13px !important;
    color: var(--color-primary) !important;
    padding: 8px !important;
    text-decoration: none !important;
}

/* Today highlight */
.fc .fc-day-today {
    background: rgba(22, 22, 22, 0.03) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    font-weight: 600 !important;
    background: var(--color-primary);
    color: white !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Other month days */
.fc .fc-day-other .fc-daygrid-day-number {
    color: var(--color-muted) !important;
    opacity: 0.5;
}

/* Events — General */
.fc .fc-event {
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 12px !important;
    font-family: var(--font-ibm) !important;
    cursor: pointer !important;
    border-width: 1px !important;
    transition: opacity 0.15s ease;
}

.fc .fc-event:hover {
    opacity: 0.85;
}

.fc .fc-event-title {
    font-weight: 400 !important;
}

/* Events — Calendar events (solid) */
.fc .zl-cal-event {
    border-left-width: 3px !important;
}

/* Events — Tasks (outlined/dashed look) */
.fc .zl-cal-task {
    background: rgba(22, 22, 22, 0.03) !important;
    border-style: dashed !important;
    border-width: 1px !important;
    border-left-width: 3px !important;
    border-left-style: solid !important;
}

/* More events link */
.fc .fc-daygrid-more-link {
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: var(--color-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* Popover (more events) */
.fc .fc-popover {
    border: 1px solid rgba(22, 22, 22, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

.fc .fc-popover-header {
    background: rgba(22, 22, 22, 0.03) !important;
    padding: 8px 12px !important;
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--color-muted) !important;
}

/* Week view time grid */
.fc .fc-timegrid-slot {
    border-color: rgba(22, 22, 22, 0.06) !important;
    height: 48px !important;
}

.fc .fc-timegrid-slot-label-cushion {
    font-family: var(--font-mono) !important;
    font-size: 10px !important;
    color: var(--color-muted) !important;
}

/* List view */
.fc .fc-list {
    border: none !important;
}

.fc .fc-list-day-cushion {
    background: rgba(22, 22, 22, 0.03) !important;
    padding: 8px 16px !important;
}

.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
    font-family: var(--font-ibm) !important;
    font-size: 13px !important;
    color: var(--color-primary) !important;
    text-decoration: none !important;
    text-transform: capitalize;
}

.fc .fc-list-event {
    cursor: pointer !important;
}

.fc .fc-list-event:hover td {
    background: rgba(22, 22, 22, 0.02) !important;
}

.fc .fc-list-event-title {
    font-family: var(--font-ibm) !important;
    font-size: 13px !important;
}

.fc .fc-list-event-dot {
    border-radius: 3px !important;
}

/* General table borders */
.fc td, .fc th {
    border-color: rgba(22, 22, 22, 0.06) !important;
}

.fc .fc-scrollgrid {
    border-color: rgba(22, 22, 22, 0.1) !important;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    /* Prevent horizontal overflow on mobile */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    /* Touch-friendly targets */
    button, .clickable, nav a {
        min-height: 44px;
    }

    /* Modal adjustments */
    .modal-content,
    [class*="max-w-2xl"],
    [class*="max-w-xl"] {
        max-width: calc(100vw - 2rem) !important;
        margin: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}
