/* Shared admin theme aligned with main Shop Tech Support brand */

:root {
    --sidebar-width: 280px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--primary-black) 0%, var(--dark-bg) 100%);
    color: var(--text-light);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
}

.header {
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    color: var(--text-light);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    height: var(--header-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 99;
}

.header h1 {
    font-size: 22px;
    margin: 0;
    color: var(--primary-blue);
}

.header-right {
    display: flex;
    gap: 14px;
    align-items: center;
}

.header-right p {
    margin: 0;
    color: var(--text-lighter);
}

/* SIDEBAR NAVIGATION */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
    border-right: 1px solid rgba(37, 99, 235, 0.2);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.08));
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header p {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: var(--text-lighter);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav a:hover {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-blue);
    padding-left: 18px;
}

.sidebar-nav a.active {
    background: rgba(37, 99, 235, 0.15);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 18px;
    min-width: 20px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(37, 99, 235, 0.2);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.sidebar-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

/* MOBILE MENU TOGGLE */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

/* MAIN CONTENT WRAPPER */
.admin-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.inline-form {
    display: inline;
}

.container {
    max-width: 1400px;
    margin: calc(var(--header-height) + 22px) auto 22px;
    padding: 0 20px;
    flex: 1;
}

.search-bar {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.92), rgba(26, 26, 26, 0.92));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-bar input {
    flex: 1;
    background: rgba(9, 9, 9, 0.9);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-light);
    font-size: 14px;
}

.search-bar input::placeholder {
    color: var(--text-lighter);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-bar button {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: #fff;
    border: 1px solid rgba(37, 99, 235, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
}

.search-bar button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.login-nav-center {
    justify-content: center;
    margin-bottom: 14px;
}

.nav-btn,
.filter-btn,
.action-links a,
.btn-back,
.btn-update,
.btn-submit,
.logout-btn,
.btn-login {
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.5);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.nav-btn:hover,
.filter-btn:hover,
.action-links a:hover,
.btn-back:hover,
.btn-update:hover,
.btn-submit:hover,
.logout-btn:hover,
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.nav-btn.active,
.filter-btn.active {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-purple));
    border-color: rgba(124, 58, 237, 0.6);
}

.logout-btn {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    border-color: rgba(239, 68, 68, 0.45);
}

.btn-update,
.btn-submit {
    background: linear-gradient(135deg, #1f8f4d, #15753e);
    border-color: rgba(46, 204, 113, 0.35);
}

.btn-back {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: rgba(156, 163, 175, 0.35);
}

.error,
.success {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid;
}

.error {
    color: #fecaca;
    background-color: rgba(127, 29, 29, 0.35);
    border-left-color: #ef4444;
}

.success {
    color: #bbf7d0;
    background-color: rgba(20, 83, 45, 0.35);
    border-left-color: #22c55e;
}

.table-container,
.detail-card,
.diagnostics-section,
.form-container,
.issues-table,
.stat-card,
.login-container {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.92), rgba(26, 26, 26, 0.92));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.login-container {
    max-width: 430px;
    margin: 90px auto;
    padding: 24px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary-blue);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-lighter);
}

.form-group input,
.form-group select,
.form-group textarea,
.ticket-selector input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-light);
    background: rgba(9, 9, 9, 0.9);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.ticket-selector input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.login-info {
    margin-top: 18px;
    padding: 12px;
    background: rgba(37, 99, 235, 0.1);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    color: var(--text-lighter);
    font-size: 12px;
}

.login-info p {
    margin: 4px 0;
}

.dashboard-grid,
.stats-grid,
.ticket-detail-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ticket-detail-container {
    grid-template-columns: 1fr 1fr;
}

.stat-card {
    padding: 18px;
    text-align: center;
    border-left: 4px solid var(--primary-blue);
}

.stat-card h3 {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .number {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-blue);
}

.section-title,
.section-heading {
    margin: 28px 0 14px;
    color: var(--primary-blue);
}

.issue-heading {
    margin-top: 20px;
}

.issues-heading {
    padding: 20px 20px 0;
    color: var(--primary-blue);
}

.detail-card,
.form-container,
.diagnostics-section {
    padding: 18px;
}

.detail-card h3,
.form-container h3,
.diagnostics-section h3 {
    margin-bottom: 14px;
    color: var(--primary-blue);
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
    padding-bottom: 10px;
}

.detail-row {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.detail-label {
    font-weight: 700;
    color: var(--text-lighter);
}

.detail-value {
    color: var(--text-light);
    text-align: right;
    word-break: break-word;
}

.table-container,
.issues-table {
    overflow-x: auto;
}

thead {
    background-color: rgba(37, 99, 235, 0.12);
    border-bottom: 1px solid rgba(37, 99, 235, 0.25);
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    color: var(--text-light);
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.08);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-submitted { background-color: #0f3f52; color: #9ed8e7; }
.status-in_progress { background-color: #5a4416; color: #f8d98f; }
.status-waiting_parts { background-color: #5b1e26; color: #f5b9c0; }
.status-completed { background-color: #1b4b2c; color: #b7f1c8; }

/* PRIORITY INDICATORS */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-high {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.2));
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(194, 65, 12, 0.2));
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.priority-low {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(20, 83, 45, 0.2));
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* URGENCY INDICATOR */
.urgency-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(194, 65, 12, 0.15));
    color: #fdba74;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* IMPROVED TABLE STYLING */
table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 14px;
}

thead {
    background-color: rgba(37, 99, 235, 0.12);
    border-bottom: 1px solid rgba(37, 99, 235, 0.25);
}

th {
    padding: 14px 16px;
    text-align: left;
    color: var(--primary-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    text-align: left;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.08);
}

.action-links {
    display: flex;
    gap: 8px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.diagnostic-item {
    background: rgba(30, 41, 59, 0.28);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.diagnostic-item p {
    margin-bottom: 8px;
}

.no-data {
    text-align: center;
    padding: 24px;
    color: var(--text-lighter);
}

.info-note {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(37, 99, 235, 0.12);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

@media (max-width: 860px) {
    :root {
        --sidebar-width: 0;
    }

    body {
        flex-direction: column;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header {
        left: 0;
        position: fixed;
        width: 100%;
    }

    .admin-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .container {
        margin-top: calc(var(--header-height) + 22px);
    }

    .ticket-detail-container {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar input,
    .search-bar button {
        width: 100%;
    }

    .nav-buttons {
        flex-direction: column;
    }

    .nav-buttons .nav-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    :root {
        --header-height: 70px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header-right {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

    .container {
        padding: 0 12px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
    }
}
