:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
    background-attachment: fixed;
    line-height: 1.5;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* --- Login --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

input[type="password"], .search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="password"] {
    margin-bottom: 20px;
}

input[type="password"]:focus, .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

button, .btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.1s;
    text-align: center;
}

.login-card button {
    width: 100%;
    font-size: 16px;
}

button:hover, .btn:hover {
    background: var(--primary-hover);
}

button:active, .btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.error-msg {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: 20px;
    font-size: 14px;
}

/* --- Dashboard --- */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-out;
}

.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.glass-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #e2e8f0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logout-btn {
    text-decoration: none;
    color: white;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-controls {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.search-input {
    width: 100%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.2);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

th:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.sort-icon {
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.5;
}

td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--glass-border);
    color: #e2e8f0;
}

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

tr {
    transition: background-color 0.2s;
}

tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

td a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
}

td a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.comments-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: auto;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
    background: none;
    transform: none;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
    letter-spacing: 0.05em;
}

.detail-group p {
    font-size: 15px;
    color: var(--text-color);
    word-break: break-word;
}

.detail-group.full-width {
    grid-column: 1 / -1;
}

.comment-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.clickable-row {
    cursor: pointer;
}
.clickable-row:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.not-found-card h1 {
    font-size: 72px;
    margin-bottom: 0;
}
.not-found-card h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
