@charset "UTF-8";

/* ==========================================================================
   Base Variables (Copied from Main Site)
   ========================================================================== */
:root {
    /* Monochrome Palette */
    --bg-dark: #000000;
    --bg-darker: #050505;
    --card-bg: rgba(20, 20, 20, 0.6);
    --card-border: rgba(255, 255, 255, 0.15);
    
    --primary: #6366f1; /* Admin Accent Color */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #ffffff;
    --text-muted: #888888;
    
    --font-main: 'Inter', sans-serif;
    --font-display: 'Rajdhani', sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    text-align: center;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: white;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

select.form-control option {
    background-color: #1a1a1a;
    color: white;
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   Admin Layout
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: rgba(10, 10, 10, 0.95);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    text-align: center;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    flex: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 10px;
}

.menu-item a:hover, .menu-item a.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--card-border);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    width: calc(100% - 250px);
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.user-info {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.user-info strong {
    color: var(--primary);
    margin-left: 0.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 2rem;
    font-family: var(--font-display);
    margin: 0;
}

.stat-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

/* Utilities */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-sm:hover {
    background: white;
    color: black;
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Actions */
.actions-row {
    display: flex;
    justify-content: flex-end; /* Align right */
    align-items: center;
    gap: 1rem; /* Consistent spacing */
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.btn-warning-soft {
    padding: 0.8rem 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    color: #f59e0b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-warning-soft:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.btn-primary {
    /* Ensure it matches height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto; /* Not full width */
    min-width: 200px;
}

/* Footer */
.admin-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Ticket Chat */
.ticket-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-list {
    flex: 1;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    max-width: 85%;
    position: relative;
}

.message.user {
    align-self: flex-start;
    background: #2a2a35;
    border-bottom-left-radius: 0;
}

.message.admin {
    align-self: flex-end;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-bottom-right-radius: 0;
}

.message .meta {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.message .content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.reply-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: white;
    width: 100%;
    border-radius: 6px;
    padding: 1rem;
    resize: vertical;
    font-family: var(--font-main);
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.status-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: white;
}

.modal-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-family: var(--font-display);
    margin: 0;
}
