/* ================= RESET & BASE ================= */

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f5f7fb;
    color: #0f172a;
    line-height: 1.5;
}

/* ================= LAYOUT ================= */

.app {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ================= SIDEBAR ================= */

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #e5e7eb;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width .2s ease;
    border-right: 1px solid rgba(255,255,255,.08);
}

/* collapsed state */
.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge {
    display: none;
}

/* ================= LOGO ================= */

.logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .4px;
}

.logo-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* hamburger */
.sidebar-toggle {
    background: none;
    border: none;
    color: #cbd5f5;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

/* ================= NAV ================= */

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ðŸ”´ HARD RESET FOR LINKS */
.sidebar .nav a,
.sidebar .nav a:visited {
    color: #cbd5f5 !important;
}

/* item */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
    width: 100%;
}

/* hover */
.nav-item:hover {
    background: rgba(255,255,255,.10);
    color: #fff !important;
}

/* active */
.nav-item.active {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}

/* danger */
.nav-item.danger {
    color: #fecaca !important;
}

.nav-item.danger:hover {
    background: rgba(239,68,68,.18);
    color: #fff !important;
}

/* label */
.nav-label {
    flex: 1;
}

/* badge */
.nav-badge {
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

/* separator */
.nav-separator {
    height: 1px;
    background: rgba(255,255,255,.12);
    margin: 12px 0;
}

/* ================= CONTENT ================= */

.content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 26px;
}

.page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

/* ================= CARDS ================= */

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow:
        0 12px 28px rgba(15,23,42,.06),
        0 4px 12px rgba(15,23,42,.04);
    margin-bottom: 24px;
}

/* ================= GRID / STATS ================= */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 22px;
}

.stat {
    font-size: 32px;
    font-weight: 700;
}

/* ================= TABLE ================= */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

th {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

/* Numeric columns - right align */
td.numeric,
th.numeric {
    text-align: right;
}

/* Center align for status/badges */
td.center,
th.center {
    text-align: center;
}

/* ================= BUTTONS ================= */

button,
a.secondary {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s ease;
}

button.secondary {
    background: #64748b;
}

button.danger {
    background: #dc2626;
}

/* ================= FORMS ================= */

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    font-size: 13px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        height: 100vh;
        left: 0;
        top: 0;
    }

    .content {
        padding: 24px;
        margin-left: 64px;
    }
}

/* ================= FORM SPACING FIX ================= */

/* spacing vertical standard între câmpuri */
form input,
form select,
form textarea {
    margin-bottom: 14px;
}

/* butoanele să nu fie lipite de input */
form button {
    margin-top: 6px;
}

/* formulare inline (ex: create dataset row) */
form[style*="display:flex"] input,
form[style*="display:flex"] select {
    margin-bottom: 0;
}

/* login page specific polish */
.content form {
    display: flex;
    flex-direction: column;
}

/* mic breathing room sub titlu */
.card h2,
.card h3 {
    margin-bottom: 18px;
}

/* ================= BADGES ================= */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    line-height: 1.4;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-frozen {
    background: #fef3c7;
    color: #92400e;
}

.badge-disabled {
    background: #fee2e2;
    color: #991b1b;
}

/* ================= BUTTONS (enhanced) ================= */

.button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s ease, transform .1s ease;
    text-decoration: none;
}

.button:hover {
    transform: translateY(-1px);
}

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

.button.primary:hover {
    background: #1d4ed8;
}

.button.secondary {
    background: #64748b;
    color: #fff;
}

.button.secondary:hover {
    background: #475569;
}

/* ================= TABLE ENHANCEMENTS ================= */

table tbody tr {
    transition: background .15s ease;
}

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

table tbody tr:last-child td {
    border-bottom: none;
}

/* ================= EMPTY STATES ================= */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ================= TOGGLE SWITCH ================= */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #2563eb;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch input:disabled + .toggle-slider:before {
    background-color: #f1f5f9;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
}

.toggle-label-text {
    user-select: none;
}

/* ================= DEMO MODE ================= */
.demo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
}

.demo-banner__label {
    background: #f97316;
    color: #fff;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.demo-banner__text {
    flex: 1;
    font-size: 14px;
}

.demo-banner__cta a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

.demo-callout {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}
