/* =============================================
   Rm.Admin.Ui — Shared Admin Base Styles
   Served at: _content/Rm.Admin.Ui/css/admin-base.css
   ============================================= */

:root {
    --admin-brand: #c8a951;
    --admin-brand-light: rgba(200, 169, 81, 0.12);
    --admin-brand-border: rgba(200, 169, 81, 0.6);
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --sidebar-text: #a1a7b3;
    --sidebar-text-hover: #fff;
    --sidebar-active-bg: rgba(200, 169, 81, 0.1);
    --topbar-height: 56px;
}

body {
    background-color: #f5f6fa;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand:hover { text-decoration: none; color: inherit; }

.sidebar-brand-text {
    color: var(--admin-brand);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sidebar-brand .brand-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-brand);
    background: rgba(200, 169, 81, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-nav:hover {
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.nav-section {
    padding: 0.5rem 1.5rem 0.25rem;
    margin-top: 0.5rem;
}

.nav-section:first-child { margin-top: 0; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.25rem;
}

.nav-item-admin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-item-admin:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

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

.nav-item-admin i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
}

.sidebar-footer .btn-logout:hover { color: #f87171; }

/* ── Top bar ── */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1030;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb-link:hover { color: #374151; }

.breadcrumb-sep {
    font-size: 0.6rem;
    color: #d1d5db;
}

.breadcrumb-current {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1d23;
}

.admin-topbar .topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-visit-site {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #6b7280;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-visit-site:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── Main content ── */
.admin-main {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 1.5rem);
    padding-bottom: 2rem;
    min-height: 100vh;
}

.admin-main .container-fluid {
    max-width: 1400px;
    padding: 0 1.5rem;
}

/* ── Page Headers ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.page-header-title {
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
    color: #1a1d23;
}

.page-header-subtitle {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0.1rem 0 0;
}

/* ── Cards ── */
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.admin-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

.admin-card-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.admin-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0;
}

.admin-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1d23;
    margin: 0;
}

.admin-card-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 2px 0 0;
}

.admin-card-body {
    padding: 1.25rem;
}

.admin-card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

/* ── Tables ── */
.admin-table {
    width: 100%;
    font-size: 0.875rem;
}

.admin-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f9fafb; }
.admin-table .cell-name { font-weight: 600; color: #1a1d23; }
.admin-table .cell-muted { color: #9ca3af; }
.admin-table .cell-actions { text-align: right; white-space: nowrap; }

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    line-height: 1.3;
}

.status-pending { background: rgba(200, 169, 81, 0.15); color: #a68b3c; }
.status-requested { background: rgba(200, 169, 81, 0.15); color: #a68b3c; }
.status-estimated { background: rgba(168, 85, 247, 0.12); color: #7c3aed; }
.status-accepted { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status-declined { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.status-inprogress { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status-completed { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.status-needsinput { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.status-active { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.status-inactive { background: rgba(156, 163, 175, 0.15); color: #6b7280; }

/* ── Buttons ── */
.btn-gold {
    background: var(--admin-brand);
    color: #1a1d23;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.btn-gold:hover { background: #b8993e; color: #1a1d23; }
.btn-gold:active { background: #a88a38; }

.btn-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: 1px solid #e5e7eb;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-subtle:hover {
    color: #374151;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-icon-action:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.btn-icon-action.danger:hover {
    border-color: #fca5a5;
    color: #dc2626;
    background: #fef2f2;
}

/* ── Alerts ── */
.admin-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border: none;
}

.admin-alert-success { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.admin-alert-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-text { font-size: 0.9rem; }

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.filter-btn.active {
    background: var(--admin-brand);
    color: #1a1d23;
    border-color: var(--admin-brand);
}

/* ── Back Link ── */
.admin-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s;
}

.admin-back-link:hover { color: #1a1d23; }

/* ── Form Improvements (inside admin-card) ── */
.admin-card .form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: #374151;
    margin-bottom: 0.35rem;
}

.admin-card .form-control,
.admin-card .form-select {
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: #e5e7eb;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-card .form-control:focus,
.admin-card .form-select:focus {
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

/* ── Mobile sidebar toggle ── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: #374151;
    cursor: pointer;
    margin-right: 0.75rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

/* ── Login Page ── */
.admin-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1a1d23;
    margin: 0;
}

.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }

.login-brand { text-align: center; margin-bottom: 2rem; }

.login-brand-name {
    color: var(--admin-brand);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.login-brand img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.login-brand .brand-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-brand);
    background: rgba(200, 169, 81, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.75rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 2rem;
}

.login-card h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1d23;
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #374151;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    border-color: #e5e7eb;
}

.login-card .form-control:focus {
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.btn-login {
    background: var(--admin-brand);
    border: none;
    color: #1a1d23;
    font-weight: 600;
    padding: 0.65rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.btn-login:hover { background: #b8993e; color: #1a1d23; }

.login-alert {
    border-radius: 10px;
    padding: 0.65rem 0.875rem;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Comment Cards ── */
.comment-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
}

.comment-card.is-admin {
    border-left: 3px solid var(--admin-brand);
    background: #fffdf5;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.comment-author { font-weight: 600; font-size: 0.85rem; color: #1a1d23; }
.comment-time { font-size: 0.75rem; color: #9ca3af; }
.comment-body { font-size: 0.875rem; color: #374151; line-height: 1.5; }
.comment-body p { margin: 0 0 0.5rem; }
.comment-body p:last-child { margin-bottom: 0; }

.badge-admin {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(200, 169, 81, 0.15);
    color: #a68b3c;
    margin-left: 0.35rem;
}

/* ── Comments Section Header ── */
.comments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.comments-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1d23;
    margin: 0;
}

.comments-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ── Ticket Info ── */
.ticket-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #6b7280;
}

.ticket-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ticket-meta-item i { font-size: 0.9rem; color: #9ca3af; }

.ticket-description {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .admin-topbar { left: 0; }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 767.98px) {
    .admin-main .container-fluid { padding: 0 1rem; }
    .ticket-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}
