/* Medical / Professional Theme for Casmat - Orange Edition */
:root {
    /* Dark Mode (Default) - Futuristic Space Blue base with Orange Accents */
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --surface-color: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;

    --primary-color: #f97316;
    /* Orange 500 */
    --primary-hover: #ea580c;
    /* Orange 600 */
    --secondary-color: #f59e0b;
    /* Amber 500 */
    --accent-color: #fbbf24;
    /* Amber 400 */

    --success-color: #22c55e;
    --warning-color: #fcd34d;
    --danger-color: #ef4444;
    --border-color: #334155;

    /* Spacing & Effects */
    --radius: 12px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(249, 115, 22, 0.3);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    --transition-speed: 0.3s;
}

body.light-mode {
    --bg-color: #f8fafc;
    --sidebar-bg: #fff;
    --surface-color: #fff;
    --text-color: #1e293b;
    --text-muted: #64748b;

    --border-color: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 15px rgba(249, 115, 22, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    margin: 0;
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    margin-top: 0;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.7rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.3rem;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-color);
    flex-shrink: 0;
    padding: 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transition: background-color var(--transition-speed);
}

.sidebar h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.sidebar p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sidebar hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    padding: 0.85rem 1.2rem;
    margin-bottom: 0.75rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(249, 115, 22, 0.03);
    border: 1px solid transparent;
}

.sidebar a:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.1), transparent);
    color: var(--primary-color);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.1);
    transform: translateX(5px);
}

.sidebar a:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}

.logout-header:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    padding-top: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: var(--bg-color);
    transition: background-color var(--transition-speed);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.header-top h2 {
    margin: 0;
    color: var(--primary-color);
}

/* Components */
.glass-panel,
.frame-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    color: var(--text-color);
    margin-bottom: 1.5rem;
    transition: background-color var(--transition-speed), border var(--transition-speed);
}

/* Buttons */
.btn-primary,
button[type="submit"],
.btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover,
button[type="submit"]:hover,
.btn-new:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--surface-color);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* DataTables Styling */
table.dataTable {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-color);
    width: 100% !important;
}

table.dataTable thead th {
    background-color: var(--border-color) !important;
    color: var(--text-color) !important;
    padding: 1rem !important;
}

table.dataTable tbody td {
    padding: 1rem !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

table.dataTable tbody tr:hover {
    background-color: rgba(249, 115, 22, 0.05) !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--surface-color);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--primary-color);
    width: 80%;
    max-width: 600px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-glow);
    animation: modalSlideIn 0.3s ease-out;
    color: var(--text-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.close {
    color: var(--text-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.neon-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(249, 115, 22, 0), rgba(249, 115, 22, 0.75), rgba(249, 115, 22, 0));
    margin: 1.5rem 0;
}

/* Theme Switcher Button Style */
.theme-switch {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.theme-switch:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--primary-color);
}