:root {
    --bg-dark: #0d0d1a;
    --bg-panel: #1a1a2e;
    --bg-panel-hover: #23233e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #9333ea;
    --primary-hover: #7e22ce;
    --border-color: #334155;
    
    --status-waiting-bg: rgba(245, 158, 11, 0.1);
    --status-waiting-text: #fcd34d;
    --status-active-bg: rgba(147, 51, 234, 0.1);
    --status-active-text: #d8b4fe;
    --status-done-bg: rgba(16, 185, 129, 0.1);
    --status-done-text: #6ee7b7;
    
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', sans-serif;
}

/* Utils */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Header */
.admin-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.admin-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.admin-header h1 span {
    font-weight: 400;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Inputs & Buttons */
input, select {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-panel-hover);
}

.btn-icon {
    padding: 0.4rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-icon:hover {
    color: var(--text-main);
    background-color: rgba(255,255,255,0.1);
}
.btn-icon.danger:hover {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Main Layout */
.admin-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.doctor-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.doctor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.doctor-item:hover {
    background-color: var(--bg-panel-hover);
}

.doctor-item.active {
    background-color: rgba(147, 51, 234, 0.1);
    border-left-color: var(--primary-color);
}

.doc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--bg-dark);
}

.doc-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.doc-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
}

.content-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.operations-container {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Table */
.operations-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.operations-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.operations-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-panel);
    vertical-align: middle;
}

.operations-table tr {
    transition: transform 0.2s;
}

.operations-table tr:hover td {
    background-color: var(--bg-panel-hover);
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    text-align: center;
}

.drag-handle:active {
    cursor: grabbing;
}

.patient-name {
    font-weight: 600;
    font-size: 1rem;
}

.lens-badge {
    font-size: 0.8rem;
    background-color: var(--bg-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Status Badges & Select */
.status-select {
    appearance: none;
    background-color: transparent;
    border: none;
    padding: 0.4rem 2rem 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
}

.status-waiting {
    background-color: var(--status-waiting-bg);
    color: var(--status-waiting-text);
}
.status-active {
    background-color: var(--status-active-bg);
    color: var(--status-active-text);
}
.status-done {
    background-color: var(--status-done-bg);
    color: var(--status-done-text);
}

.tr-done .patient-name, .tr-done .op-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background-color: var(--bg-panel);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transform: translateY(-20px);
    animation: slideDown 0.3s forwards;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover { color: white; }

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background-color: var(--danger-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); }
    to { transform: translateY(0); }
}
