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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(233, 115, 13, 0.85) 0%, rgba(255, 140, 58, 0.85) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    min-width: 320px;
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.logo {
    max-width: 160px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.login-box h1 {
    color: #e9730d;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.login-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 100;
}

.login-footer img {
    height: 30px;
    width: auto;
}

.login-footer span {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-group input:focus {
    outline: none;
    border-color: #e9730d;
    background: white;
    box-shadow: 0 0 0 3px rgba(233, 115, 13, 0.1);
}

button {
    background-color: #e9730d;
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 0.5rem;
}

button:hover {
    background-color: #d1650b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 115, 13, 0.3);
}

button:active {
    transform: translateY(0);
}

/* Message Styles */
.message {
    margin-top: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

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

.message-error {
    color: #c62828;
    background-color: #ffebee;
    border-left: 4px solid #c62828;
}

.message-warning {
    color: #f57c00;
    background-color: #fff3e0;
    border-left: 4px solid #f57c00;
}

.message-info {
    color: #1976d2;
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.message::before {
    font-size: 1.2rem;
}

.message-error::before {
    content: '❌';
}

.message-warning::before {
    content: '⚠️';
}

.message-info::before {
    content: 'ℹ️';
}

/* Legacy support for error-message class */
.error-message {
    color: #c62828;
    margin-top: 1rem;
    padding: 0.875rem;
    background-color: #ffebee;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    font-weight: 500;
}

/* Dashboard Styles */
.header {
    background-color: #e9730d;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-logo {
    height: 40px;
    width: auto;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    margin: 0;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
}

.dashboard {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.nav-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(233, 115, 13, 0.2);
    border-color: #e9730d;
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.nav-card h3 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

/* FD Locations Page Styles */
.page-controls {
    margin-bottom: 2rem;
}

.controls-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #e9730d;
}

.filter-container {
    min-width: 200px;
}

.location-filter {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.location-filter:focus {
    outline: none;
    border-color: #e9730d;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #e9730d;
    font-size: 1.1rem;
}

.fd-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fd-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.fd-card:hover {
    box-shadow: 0 4px 15px rgba(233, 115, 13, 0.15);
}

.fd-card.expanded {
    box-shadow: 0 4px 15px rgba(233, 115, 13, 0.2);
}

.fd-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fd-card-header:hover {
    background-color: #f8f9fa;
}

.fd-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #e9730d;
    min-width: 80px;
}

.fd-location {
    flex: 1;
    margin-left: 1rem;
    color: #666;
}

.expand-icon {
    color: #e9730d;
    font-weight: bold;
    transition: transform 0.3s;
}

.fd-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.fd-card-details {
    display: none;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid #eee;
    background-color: #fafafa;
}

.detail-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    color: #333;
    display: inline-block;
    min-width: 100px;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Admin Page Styles */
.admin-header {
    background: linear-gradient(135deg, #d1650b 0%, #e9730d 100%);
    position: relative;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #e9730d;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.fd-admin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-row {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-row-content {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.admin-fd-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #e9730d;
}

.admin-fd-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-fd-info span {
    font-size: 0.9rem;
    color: #666;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

/* Button Styles */
.btn-primary {
    background-color: #e9730d;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #d1650b;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-edit {
    background-color: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: #e9730d;
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e9730d;
}

.form-group input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

#fdForm {
    padding: 1.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

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

    .dashboard {
        padding: 1rem;
    }

    .nav-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
    }

    .nav-card {
        padding: 1.5rem;
    }

    .login-box {
        margin: 1rem;
        padding: 1.5rem;
    }

    .controls-row {
        flex-direction: column;
    }

    .search-container,
    .filter-container {
        min-width: unset;
    }

    .fd-card-header {
        padding: 0.75rem;
    }

    .fd-name {
        min-width: 60px;
        font-size: 1rem;
    }

    .fd-location {
        margin-left: 0.5rem;
        font-size: 0.9rem;
    }

    .detail-row strong {
        min-width: 80px;
        font-size: 0.9rem;
    }

    .admin-stats {
        flex-direction: column;
    }

    .admin-row-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .admin-actions {
        justify-content: center;
    }

    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Import Page Styles */
.import-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.import-controls {
    margin: 2rem 0;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-name {
    color: #666;
    font-style: italic;
}

.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.preview-table {
    margin: 1rem 0;
    overflow-x: auto;
}

.preview-table-content {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.preview-table-content th,
.preview-table-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.preview-table-content th {
    background-color: #e9730d;
    color: white;
    font-weight: bold;
}

.preview-table-content tr:hover {
    background-color: #f8f9fa;
}

.import-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.import-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
}

.import-status .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: 5px;
}

.import-status .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 5px;
}

.existing-data-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contacts-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.dept-summary {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 5px;
    border-left: 4px solid #e9730d;
}

/* Contacts page uses same styles as FD page - no additional CSS needed */
.btn-call {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: none;
    cursor: pointer;
}

.btn-call:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

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

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: modalSlideIn 0.25s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    color: #1a1a1a;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-modal {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-intern {
    background-color: #e9730d;
    color: white;
    box-shadow: 0 2px 8px rgba(233, 115, 13, 0.25);
}

.btn-intern:hover {
    background-color: #d1650b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 115, 13, 0.35);
}

.btn-prive {
    background-color: #495057;
    color: white;
    box-shadow: 0 2px 8px rgba(73, 80, 87, 0.25);
}

.btn-prive:hover {
    background-color: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.35);
}

.btn-cancel {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1.5px solid #e9ecef;
    box-shadow: none;
}

.btn-cancel:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
}

/* Contact subcards styling */
.contact-subcard {
    margin: 0.75rem 0;
    margin-left: 1rem;
    border-left: 3px solid #e9730d;
    background-color: #fafafa;
}

.contact-subcard .fd-card-header {
    background-color: #f8f9fa;
}

.contact-subcard .fd-card-header:hover {
    background-color: #e9ecef;
}

.department-contacts-list {
    padding: 0.5rem 0;
}

/* Responsive for Import and Contacts */
@media (max-width: 768px) {
    .import-section,
    .existing-data-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .file-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .import-actions {
        flex-direction: column;
    }

    .contacts-summary {
        flex-direction: column;
    }

    .contact-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .contact-actions {
        justify-content: center;
    }

    .department-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .contact-count {
        margin-right: 0;
    }
}

/* ===== SKELETON LOADING ===== */
@keyframes skeleton-shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-list-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.skeleton-tag {
    height: 26px;
    border-radius: 13px;
    flex-shrink: 0;
}

.skeleton-order-item {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}