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

body {
    background: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.legacy-admin {
    min-height: 100vh;
    background: #fff;
    overflow-x: visible;
    width: 100%;
}

.admin-header {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 50%, #207cca 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-info {
    font-size: 14px;
}

.btn-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 7px 15px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.05) 51%, rgba(0,0,0,0.1) 100%);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 1px 2px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.btn-link:hover {
    background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 50%, rgba(0,0,0,0.05) 51%, rgba(0,0,0,0.05) 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.5) inset,
        0 1px 3px rgba(0,0,0,0.4);
}

.btn-link:active {
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.admin-body {
    display: flex;
    min-height: calc(100vh - 60px);
    overflow-x: visible;
}

.sidebar {
    width: 240px;
    background: linear-gradient(to bottom, #555 0%, #3a3a3a 50%, #2a2a2a 100%);
    color: white;
    padding: 0;
    box-shadow: 
        2px 0 5px rgba(0,0,0,0.3),
        1px 0 0 rgba(255,255,255,0.1) inset;
    border-right: 1px solid #1a1a1a;
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 3px 10px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-radius: 4px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%);
    border: 1px solid rgba(0,0,0,0.3);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.1) inset,
        0 1px 2px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
}

.menu-item:hover {
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.05) 100%);
    color: white;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.2) inset,
        0 1px 3px rgba(0,0,0,0.4);
}

.menu-item:active {
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(1px);
}

.menu-item.active {
    background: linear-gradient(to bottom, #4a90d9 0%, #3a7bb9 50%, #2a5a87 51%, #1e456e 100%);
    color: white;
    border: 1px solid #1a3d5c;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 2px 4px rgba(0,0,0,0.4),
        0 0 5px rgba(74,144,217,0.3);
}

.menu-item .icon {
    margin-right: 10px;
    font-size: 16px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

.main-content {
    flex: 1;
    padding: 25px;
    background: #e5e5e5 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAGklEQVQIHWNgYGD4z8DAwMgABhgZGBj+AwAFXgEB7XxQPgAAAABJRU5ErkJggg==');
    overflow-x: visible;
    min-width: 0;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

.info-box {
    background: white;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.info-box-icon {
    font-size: 32px;
    margin-right: 15px;
}

.info-box-content h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.info-box-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-box-content small {
    color: #95a5a6;
    font-size: 12px;
}

.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.alert-success {
    border-left-color: #27ae60;
    background: #d4edda;
    color: #155724;
}

.alert-error {
    border-left-color: #e74c3c;
    background: #f8d7da;
    color: #842029;
}

.content-section {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
    border: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.section-title {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-selector label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.year-input {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 14px;
    background: white;
    width: 100px;
    text-align: center;
}

.year-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-year-go {
    padding: 6px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-year-go:hover {
    background: #2980b9;
}

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: #34495e;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ecf0f1;
}

.subsection-title:first-of-type {
    margin-top: 0;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: linear-gradient(to bottom, #fafafa 0%, #efefef 100%);
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 2px 5px rgba(0,0,0,0.15);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #bbb;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.data-table thead {
    background: linear-gradient(to bottom, #f5f5f5 0%, #e5e5e5 100%);
    border-bottom: 2px solid #ccc;
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

.data-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    border-bottom: 2px solid #bbb;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.data-table td.number {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: linear-gradient(to bottom, #f0f8ff 0%, #e0f0ff 100%);
    box-shadow: 0 0 5px rgba(74,144,217,0.2) inset;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.5) inset,
        0 1px 2px rgba(0,0,0,0.15);
}

.badge-blue,
.badge-sales {
    background: linear-gradient(to bottom, #5dade2 0%, #3498db 50%, #2980b9 100%);
    color: white;
    border: 1px solid #2472a4;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

.badge-green,
.badge-visit {
    background: linear-gradient(to bottom, #5dd85d 0%, #27ae60 50%, #229954 100%);
    color: white;
    border: 1px solid #1e8449;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

.badge-purple,
.badge-teleapo {
    background: linear-gradient(to bottom, #bb8fce 0%, #9b59b6 50%, #7d3c98 100%);
    color: white;
    border: 1px solid #6c3483;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

.badge-success {
    background: linear-gradient(to bottom, #5dd85d 0%, #27ae60 50%, #229954 100%);
    color: white;
    border: 1px solid #1e8449;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

.badge-gray {
    background: linear-gradient(to bottom, #bdc3c7 0%, #95a5a6 50%, #7f8c8d 100%);
    color: white;
    border: 1px solid #6c7a7b;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}

/* Form Styles */
.legacy-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 15px;
    display: block;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

.form-control,
.form-input,
.form-textarea {
    padding: 12px 16px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    box-shadow: 
        0 1px 2px rgba(0,0,0,0.05) inset,
        0 1px 0 rgba(255,255,255,0.8);
}

.form-control:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 
        0 0 0 3px rgba(52, 152, 219, 0.15),
        0 1px 2px rgba(0,0,0,0.05) inset;
    background: white;
}

textarea.form-control,
textarea.form-input,
.form-textarea {
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    line-height: 1.6;
}

select.form-control,
select.form-input {
    cursor: pointer;
    padding-right: 32px;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"%3e%3cpath fill="%23666" d="M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z"/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(to bottom, #5dade2 0%, #3498db 50%, #2980b9 51%, #2472a4 100%);
    color: white;
    border: 1px solid #1f5a85;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 2px 4px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #6bb9e8 0%, #3da3e3 50%, #2e86c0 51%, #2879ab 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 5px rgba(0,0,0,0.4);
}

.btn-primary:active {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.btn-success {
    background: linear-gradient(to bottom, #5dd85d 0%, #27ae60 50%, #229954 51%, #1e8449 100%);
    color: white;
    border: 1px solid #196f3d;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 2px 4px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.btn-success:hover {
    background: linear-gradient(to bottom, #6be06b 0%, #2eb867 50%, #26a65b 51%, #218b51 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 5px rgba(0,0,0,0.4);
}

.btn-success:active {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.btn-secondary {
    background: linear-gradient(to bottom, #95a5a6 0%, #7f8c8d 50%, #6c7a7b 51%, #5d6d6e 100%);
    color: white;
    border: 1px solid #4e5f60;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 2px 4px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #a1b1b2 0%, #8b989a 50%, #788586 51%, #697677 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 5px rgba(0,0,0,0.4);
}

.btn-secondary:active {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.btn-danger {
    background: linear-gradient(to bottom, #ec7063 0%, #e74c3c 50%, #cb4335 51%, #b03a2e 100%);
    color: white;
    border: 1px solid #943126;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 2px 4px rgba(0,0,0,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #f17c6d 0%, #ef5747 50%, #d74b3f 51%, #bb4133 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 5px rgba(0,0,0,0.4);
}

.btn-danger:active {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.3) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

/* Action Buttons for Edit/Delete */
.btn-action {
    padding: 6px 14px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    margin: 0 3px;
}

.btn-edit {
    background: linear-gradient(to bottom, #5dade2 0%, #3498db 50%, #2980b9 51%, #2472a4 100%);
    color: white;
    border: 1px solid #1f5a85;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 1px 2px rgba(0,0,0,0.25);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}

.btn-edit:hover {
    background: linear-gradient(to bottom, #6bb9e8 0%, #3da3e3 50%, #2e86c0 51%, #2879ab 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 4px rgba(0,0,0,0.3);
}

.btn-edit:active {
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.25) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.btn-delete {
    background: linear-gradient(to bottom, #ec7063 0%, #e74c3c 50%, #cb4335 51%, #b03a2e 100%);
    color: white;
    border: 1px solid #943126;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 1px 2px rgba(0,0,0,0.25);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}

.btn-delete:hover {
    background: linear-gradient(to bottom, #f17c6d 0%, #ef5747 50%, #d74b3f 51%, #bb4133 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 2px 4px rgba(0,0,0,0.3);
}

.btn-delete:active {
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.25) inset,
        0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(1px);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .admin-header {
        padding: 12px 15px;
    }
    
    .admin-header h1 {
        font-size: 18px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .user-info {
        display: none;
    }
    
    .btn-link {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .sidebar {
        position: fixed;
        left: -250px;
        top: 60px;
        width: 250px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header h2 {
        font-size: 22px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .year-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
