/* ==========================================================================
   PRO AUTO SERVICE - Serviso Meistrų Pulto Stilius (admin.css)
   Švarus pramoninis-techninis SaaS stilius, Sentence Case
   ========================================================================== */

:root {
    --bg-body: #0F172A;
    --bg-surface: #1E293B;
    --bg-card: #334155;
    --bg-sidebar: #090D16;
    --border-color: #334155;
    --border-light: #475569;

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --color-blue: #3B82F6;
    --color-green: #10B981;
    --color-amber: #F59E0B;
    --color-red: #EF4444;
    --color-purple: #8B5CF6;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.admin-body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Top Alert Bar */
.admin-top-bar {
    background: #000000;
    color: var(--text-secondary);
    font-size: 0.78rem;
    padding: 0.4rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #34D399;
}

.top-bar-link {
    color: #93C5FD;
    text-decoration: none;
    font-weight: 600;
}

.top-bar-link:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

/* Layout: Sidebar + Main */
.admin-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 30px);
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--color-blue);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #FFFFFF;
}

.brand-text h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--color-amber);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
}

.nav-item.active {
    background: var(--color-blue);
    color: #FFFFFF;
    font-weight: 700;
}

.nav-item-badge {
    margin-left: auto;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.status-indicator-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #34D399;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-body);
}

/* Header */
.admin-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-input-wrap {
    position: relative;
    width: 280px;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    background: #0F172A;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
}

.search-input-wrap svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-blue);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #1D4ED8;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

/* View Panels */
.view-panel {
    display: none;
    padding: 2rem;
}

.view-panel.active {
    display: block;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-val {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.kpi-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Cards & Tables */
.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.card-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th {
    background: #0F172A;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    vertical-align: middle;
}

.data-table tr:hover {
    background: rgba(51, 65, 85, 0.2);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-badge.vykdomas { background: rgba(59, 130, 246, 0.2); color: #60A5FA; }
.status-badge.priimtas { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.status-badge.new, .status-badge.naujas { background: rgba(139, 92, 246, 0.2); color: #C084FC; }
.status-badge.ivykdytas { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.status-badge.atsauktas { background: rgba(239, 68, 68, 0.2); color: #F87171; }

/* Timetable 3-Columns Grid */
.timetable-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.date-nav-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-input-field {
    background: #0F172A;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
}

.timetable-3cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.bay-col {
    background: #0F172A;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.bay-col-header {
    background: #1E293B;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.bay-col-title {
    font-weight: 800;
    font-size: 0.95rem;
}

.bay-col-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.slots-vertical-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.timetable-slot-card {
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.timetable-slot-card.busy {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
}

.timetable-slot-card.continuation {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
}

.timetable-slot-card.free {
    background: rgba(255, 255, 255, 0.02);
    border-style: dashed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-assign-slot {
    background: #1E293B;
    color: #93C5FD;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-assign-slot:hover {
    background: var(--color-blue);
    color: #FFFFFF;
}

/* Modals */
.admin-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
}

.admin-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-dialog {
    background: #1E293B;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 650px;
    max-height: 840px;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1.75rem 2rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: #FFFFFF;
    background: #334155;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.modal-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 0.85rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.form-input-dark, .form-select-dark {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #0F172A;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
}

.form-input-dark:focus, .form-select-dark:focus {
    outline: none;
    border-color: var(--color-blue);
}

.modal-footer-btns {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.admin-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0F172A;
    border: 1px solid var(--color-green);
    color: #FFFFFF;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.25s ease;
}

.admin-toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* Language Switcher in NoStressWeb Top Banner */
.gw-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.5rem;
    padding: 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.gw-lang-btn {
    color: #9CA3AF !important;
    text-decoration: none !important;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}
.gw-lang-btn:hover {
    color: #FFFFFF !important;
}
.gw-lang-btn.active {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.22);
}
.gw-lang-sep {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
}
