/* ============================================================
   Fullsite Assistant — Style panelu
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- Login page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.login-header p {
    color: #64748b;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #475569;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #2563eb;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-full {
    width: 100%;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* --- Layout: Sidebar + Main --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #1e293b;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-header span {
    color: #94a3b8;
    font-size: 14px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 24px;
    color: #cbd5e1;
    font-size: 15px;
    transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: #334155;
    color: #fff;
    text-decoration: none;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid #334155;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 10px;
    background: #475569;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    text-decoration: none;
}

.main-content {
    margin-left: 240px;
    padding: 0 32px 32px;
    min-height: 100vh;
}

/* --- Top bar --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 32px;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 700;
}

.top-bar-info {
    display: flex;
    gap: 16px;
    color: #64748b;
    font-size: 14px;
}

/* --- Sections --- */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1e293b;
}

/* --- Grid --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Cards --- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.badge-green { background: #10b981; }
.badge-orange { background: #f59e0b; }
.badge-red { background: #ef4444; }

/* --- Ticket list --- */
.ticket-list, .outage-list {
    list-style: none;
}

.ticket-list li, .outage-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.ticket-list li:last-child, .outage-list li:last-child {
    border-bottom: none;
}

.ticket-link {
    font-weight: 600;
    white-space: nowrap;
}

.ticket-summary {
    flex: 1;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-time {
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}

.urgent {
    background: #fef2f2;
    border-radius: 6px;
    padding: 10px !important;
}

/* --- Action badges --- */
.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-zamknij { background: #dcfce7; color: #16a34a; }
.action-komentarz { background: #dbeafe; color: #2563eb; }
.action-czekaj { background: #fef3c7; color: #d97706; }
.action-pilne { background: #fecaca; color: #dc2626; }
.action-cron { background: #e2e8f0; color: #475569; }
.action-error { background: #fecaca; color: #dc2626; }
.action-overtime { background: #fecaca; color: #dc2626; }

/* --- Outage list --- */
.outage-active {
    background: #fef2f2;
    border-radius: 6px;
    padding: 12px !important;
    flex-direction: column;
    align-items: flex-start !important;
}

.outage-time {
    color: #64748b;
    font-size: 13px;
}

/* --- Empty state --- */
.empty {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.empty.success {
    color: #10b981;
}

/* --- Tables --- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.table tr:hover {
    background: #f8fafc;
}

.table .warning td {
    color: #dc2626;
}

.table .overtime td {
    color: #dc2626;
    font-weight: 700;
}

.nowrap {
    white-space: nowrap;
}

/* --- Progress bar --- */
.progress-bar {
    position: relative;
    height: 24px;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    min-width: 120px;
}

.progress-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s;
    background: #10b981;
}

.progress-fill.warning {
    background: #f59e0b;
}

.progress-fill.overtime {
    background: #ef4444;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

/* --- Package badges --- */
.package-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pkg-ultimate { background: #fef3c7; color: #92400e; }
.pkg-premium { background: #dbeafe; color: #1e40af; }
.pkg-starter { background: #dcfce7; color: #166534; }
.pkg-lite { background: #f1f5f9; color: #475569; }
.pkg-none { background: #f1f5f9; color: #94a3b8; }

/* --- Hide/Show buttons --- */
.btn-hide {
    background: none;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-hide:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-show {
    background: #dbeafe;
    border: none;
    color: #2563eb;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-show:hover {
    background: #2563eb;
    color: #fff;
}

.btn-toggle-hidden {
    background: none;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-toggle-hidden:hover {
    background: #f8fafc;
}

.hidden {
    display: none;
}

/* --- Log table --- */
.table-log td:first-child {
    white-space: nowrap;
    color: #64748b;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 0 16px 16px;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .table {
        font-size: 13px;
    }
    .table th, .table td {
        padding: 8px 10px;
    }
}
