/* Monitio — główny plik CSS */
/* Nie wymaga zewnętrznych zależności */

/* =============================================
   CZCIONKI
   ============================================= */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter/Inter-Bold.woff2') format('woff2');
}

/* =============================================
   CSS ZMIENNE — DESIGN TOKENS
   ============================================= */
:root {
    --color-primary:     #2563eb;
    --color-primary-h:   #1d4ed8;
    --color-success:     #16a34a;
    --color-success-h:   #15803d;
    --color-warning:     #d97706;
    --color-danger:      #dc2626;
    --color-secondary:   #475569;

    --sidebar-width:     240px;
    --topbar-height:     56px;

    --sidebar-bg:        #1e293b;
    --sidebar-text:      #94a3b8;
    --sidebar-active-bg: #2563eb;
    --sidebar-active:    #fff;

    --card-bg:           #fff;
    --card-border:       #e2e8f0;
    --card-radius:       0.5rem;

    --font-main:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:         'JetBrains Mono', 'Courier New', monospace;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

p { margin: 0; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; padding: 0; margin: 0; }

body {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    background: #f1f5f9;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.nav-section-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 1px;
}

.nav-item:hover {
    background: #334155;
    color: #e2e8f0;
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #64748b;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
    white-space: nowrap;
}

.btn:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn-primary   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-h); border-color: var(--color-primary-h); }

.btn-success   { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { background: var(--color-success-h); }

.btn-secondary { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }

.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-ghost     { background: transparent; color: #475569; }
.btn-ghost:hover { background: #f1f5f9; }

.btn-sm  { padding: 0.3125rem 0.625rem; font-size: 12.5px; }
.btn-xs  { padding: 0.1875rem 0.5rem; font-size: 12px; border-radius: 0.25rem; }
.btn-lg  { padding: 0.625rem 1.25rem; font-size: 15px; }

.btn.w-full    { width: 100%; }

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.3125rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.4375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 13.5px;
    font-family: var(--font-main);
    color: #111827;
    background: #fff;
    transition: border-color 0.12s, box-shadow 0.12s;
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-input.is-invalid,
.form-select.is-invalid {
    border-color: var(--color-danger);
}

.form-error {
    font-size: 12px;
    color: var(--color-danger);
    margin-top: 0.25rem;
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-checkbox, .form-radio {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-input-sm { padding: 0.25rem 0.5rem; font-size: 12.5px; }
.form-select-sm { padding: 0.25rem 0.5rem; font-size: 12.5px; }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table td {
    padding: 0.6875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: middle;
}

.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

.table th.text-right,
.table td.text-right { text-align: right; }

.table th.text-center,
.table td.text-center { text-align: center; }

.row-danger { background: #fef2f2 !important; }
.row-danger:hover { background: #fee2e2 !important; }
.row-warning { background: #fffbeb !important; }
.row-warning:hover { background: #fef3c7 !important; }

/* =============================================
   BADGES
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success   { background: #dcfce7; color: #15803d; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-lg        { padding: 0.3125rem 0.75rem; font-size: 13px; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 13.5px;
    border: 1px solid;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* =============================================
   STAT CARDS (Dashboard)
   ============================================= */
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-label {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}

/* =============================================
   LAYOUT UTILITIES
   ============================================= */
.grid        { display: grid; }
.grid-2      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3      { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4      { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2  { grid-column: span 2; }
.col-span-3  { grid-column: span 3; }
.gap-3       { gap: 0.75rem; }
.gap-4       { gap: 1rem; }
.gap-6       { gap: 1.5rem; }

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }

.ml-auto  { margin-left: auto; }
.mr-1     { margin-right: 0.25rem; }
.mr-2     { margin-right: 0.5rem; }
.mb-0     { margin-bottom: 0; }
.mb-1     { margin-bottom: 0.25rem; }
.mb-2     { margin-bottom: 0.5rem; }
.mb-3     { margin-bottom: 0.75rem; }
.mb-4     { margin-bottom: 1rem; }
.mb-6     { margin-bottom: 1.5rem; }
.mt-1     { margin-top: 0.25rem; }
.mt-2     { margin-top: 0.5rem; }
.mt-3     { margin-top: 0.75rem; }
.mt-4     { margin-top: 1rem; }
.pt-2     { padding-top: 0.5rem; }
.pt-3     { padding-top: 0.75rem; }
.pt-5     { padding-top: 1.25rem; }
.p-3      { padding: 0.75rem; }
.p-4      { padding: 1rem; }
.px-2     { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1     { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-6     { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8     { padding-top: 2rem; padding-bottom: 2rem; }
.py-12    { padding-top: 3rem; padding-bottom: 3rem; }

.w-full   { width: 100%; }
.w-4      { width: 1rem; }
.w-5      { width: 1.25rem; }
.w-6      { width: 1.5rem; }
.w-7      { width: 1.75rem; }
.w-8      { width: 2rem; }
.w-12     { width: 3rem; }
.w-14     { width: 3.5rem; }
.h-4      { height: 1rem; }
.h-5      { height: 1.25rem; }
.h-6      { height: 1.5rem; }
.h-7      { height: 1.75rem; }
.h-8      { height: 2rem; }
.h-12     { height: 3rem; }
.h-14     { height: 3.5rem; }
.h-16     { height: 4rem; }
.h-fit    { height: fit-content; }
.min-w-36 { min-width: 9rem; }
.min-w-40 { min-width: 10rem; }
.min-w-48 { min-width: 12rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.divide-y > * + * { border-top: 1px solid; }
.divide-slate-100 > * + * { border-top-color: #f1f5f9; }
.divide-slate-200 > * + * { border-top-color: #e2e8f0; }

.border-t       { border-top: 1px solid; }
.border-b       { border-bottom: 1px solid; }
.border-l-4     { border-left-width: 4px; border-left-style: solid; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-amber-200 { border-color: #fde68a; }
.border-amber-400 { border-color: #fbbf24; }
.border-blue-200  { border-color: #bfdbfe; }
.border-blue-300  { border-color: #93c5fd; }
.border-red-200   { border-color: #fecaca; }
.border-blue-500  { border-color: #3b82f6; }

.rounded     { border-radius: 0.25rem; }
.rounded-md  { border-radius: 0.375rem; }
.rounded-lg  { border-radius: 0.5rem; }
.rounded-xl  { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.shadow-md   { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

/* =============================================
   TYPOGRAPHY UTILITIES
   ============================================= */
.text-xs  { font-size: 12px; }
.text-sm  { font-size: 13.5px; }
.text-lg  { font-size: 17px; }
.text-xl  { font-size: 19px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 26px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-normal { font-weight: 400; }
.font-mono   { font-family: var(--font-mono); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.uppercase   { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-relaxed { line-height: 1.625; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0     { min-width: 0; }

/* Color utilities */
.text-white      { color: #fff; }
.text-slate-400  { color: #94a3b8; }
.text-slate-500  { color: #64748b; }
.text-slate-600  { color: #475569; }
.text-slate-700  { color: #334155; }
.text-slate-800  { color: #1e293b; }
.text-slate-900  { color: #0f172a; }
.text-blue-600   { color: #2563eb; }
.text-blue-700   { color: #1d4ed8; }
.text-green-600  { color: #16a34a; }
.text-green-700  { color: #15803d; }
.text-red-500    { color: #ef4444; }
.text-red-600    { color: #dc2626; }
.text-red-700    { color: #b91c1c; }
.text-amber-600  { color: #d97706; }
.text-amber-700  { color: #b45309; }
.text-amber-900  { color: #78350f; }
.text-orange-600 { color: #ea580c; }

.bg-slate-50     { background: #f8fafc; }
.bg-slate-200    { background: #e2e8f0; }
.bg-slate-600    { background: #475569; }
.bg-blue-50      { background: #eff6ff; }
.bg-blue-100     { background: #dbeafe; }
.bg-blue-500     { background: #3b82f6; }
.bg-blue-600     { background: #2563eb; }
.bg-green-100    { background: #dcfce7; }
.bg-red-50       { background: #fef2f2; }
.bg-red-100      { background: #fee2e2; }
.bg-amber-50     { background: #fffbeb; }
.bg-amber-100    { background: #fef3c7; }
.bg-slate-50     { background: #f8fafc; }

.hover\:underline:hover  { text-decoration: underline; }
.hover\:bg-slate-100:hover { background: #f1f5f9; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.hover\:border-blue-300:hover { border-color: #93c5fd; }

.transition-all    { transition: all 0.15s; }
.transition-colors { transition: color 0.12s, background 0.12s, border-color 0.12s; }
.cursor-pointer    { cursor: pointer; }

.hidden   { display: none; }
.block    { display: block; }
.inline-flex { display: inline-flex; }

.sticky   { position: sticky; }
.top-4    { top: 1rem; }

.list-disc { list-style-type: disc; }
.pl-4     { padding-left: 1rem; }

.opacity-50 { opacity: 0.5; }
.border-l   { border-left: 1px solid; }
.pl-2       { padding-left: 0.5rem; }

/* =============================================
   AUTH LAYOUT
   ============================================= */
.min-h-full { min-height: 100%; }
.py-12  { padding-top: 3rem; padding-bottom: 3rem; }
.px-4   { padding-left: 1rem; padding-right: 1rem; }

/* =============================================
   RESPONSIVE — MOBILE SIDEBAR
   ============================================= */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .lg\:hidden { display: flex; }

    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
    .lg\:hidden { display: none; }
}

@media (max-width: 640px) {
    .sm\:block { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .page-content { padding: 1rem; }
}

/* =============================================
   MISC
   ============================================= */
.prose { max-width: none; }
.p-1\.5 { padding: 0.375rem; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
