/* Panel de Administración - C.C. Ingeniería */
:root {
    --primary-dark: #003366;
    --primary: #0056b3;
    --accent: #00bcd4;
    --light-bg: #f8fbff;
    --white: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #576574;
    --border: #e0e6ed;
    --success: #4CAF50;
    --danger: #f44336;
}

body {
    background-color: var(--light-bg);
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.3);
}

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

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

/* Dashboard Sidebar */
.sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: var(--white);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--accent);
}

.nav-item {
    padding: 12px 18px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--accent);
}

.logout-btn {
    margin-top: auto;
    padding: 12px 18px;
    cursor: pointer;
    background: rgba(244, 67, 54, 0.2);
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.4);
}

/* Dashboard Content */
.content {
    flex: 1;
    padding: 40px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.panel-section {
    display: none;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.panel-section.active {
    display: block;
}

.panel-section h2 {
    margin-top: 0;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Switch styling for tabs */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Basic List Styling for CRUD */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-list li {
    padding: 15px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actions {
    display: flex;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
}

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

.link-card {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: var(--light-bg);
    cursor: pointer;
    transition: 0.3s;
}

.link-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #fff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: 'Inter', sans-serif;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}
.toast.toast-error {
    border-left-color: #ef4444;
}
.toast.show {
    transform: translateX(0);
}

/* Autotest Item Cards */
.item-card {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.item-card ul.autotest-options-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    width: 100%;
    box-sizing: border-box;
}

.item-card ul.autotest-options-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-bg);
    border: 1px solid var(--border);
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    box-sizing: border-box;
}

.item-card ul.autotest-options-list li:last-child {
    margin-bottom: 0;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}

.item-card code {
    background: #e0e6ed;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

