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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 120px;
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    padding: 30px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 10s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    color: white;
    font-size: 2em;
    margin: 0;
    position: relative;
    z-index: 1;
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1em;
    margin: 5px 0 0 0;
    position: relative;
    z-index: 1;
}

.header-content > div {
    position: relative;
    z-index: 1;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.language-selector select option {
    background: #16a085;
    color: white;
}

.main-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.nav-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #16a085;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.nav-btn.active {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
}

.section-content {
    display: none;
}

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

.zoro-header {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.zoro-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: white;
}

.zoro-header p {
    font-size: 1.2em;
    opacity: 0.95;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #16a085;
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

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

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

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.filter-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.filter-section button {
    grid-column: span 1;
}

#recordsDisplay {
    max-height: 600px;
    overflow-y: auto;
}

.record-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-right: 5px solid #16a085;
    transition: all 0.3s ease;
}

.record-item:hover {
    background: #e9ecef;
    transform: translateX(-5px);
}

.record-item.attendance {
    border-right-color: #27ae60;
}

.record-item.leave {
    border-right-color: #3498db;
}

.record-item.mission {
    border-right-color: #9b59b6;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-name {
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
}

.record-type {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: white;
}

.record-type.attendance {
    background: #27ae60;
}

.record-type.leave {
    background: #3498db;
}

.record-type.mission {
    background: #9b59b6;
}

.record-details {
    color: #666;
    line-height: 1.8;
}

.record-details strong {
    color: #333;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #ee5a6f;
    transform: scale(1.05);
}

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

.stat-card {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1.1em;
    opacity: 0.9;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2em;
}

.empty-state::before {
    content: "📭";
    display: block;
    font-size: 3em;
    margin-bottom: 15px;
}

.room-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid #16a085;
    transition: all 0.3s ease;
}

.room-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.room-card.available {
    border-left-color: #27ae60;
}

.room-card.occupied {
    border-left-color: #3498db;
}

.room-card.maintenance {
    border-left-color: #f39c12;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.room-number {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}

.room-status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: white;
}

.room-status-badge.available {
    background: #27ae60;
}

.room-status-badge.occupied {
    background: #3498db;
}

.room-status-badge.maintenance {
    background: #f39c12;
}

.room-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.room-detail-item {
    display: flex;
    flex-direction: column;
}

.room-detail-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.room-detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.room-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.room-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-room-btn {
    background: #3498db;
    color: white;
}

.edit-room-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.delete-room-btn {
    background: #ff6b6b;
    color: white;
}

.delete-room-btn:hover {
    background: #ee5a6f;
    transform: scale(1.05);
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-section {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-content > div:first-child {
        text-align: center;
        justify-content: center;
    }
    
    .header-content > div:last-child {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .main-nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .zoro-header h2 {
        font-size: 1.8em;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .room-details {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #16a085;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #27ae60;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f5576c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.success-message {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin: 15px 0;
    animation: slideInRight 0.5s ease-out;
}

.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin: 15px 0;
    animation: slideInRight 0.5s ease-out;
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    animation: fadeIn 0.3s ease-out;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 0 5px;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

.badge-info {
    background: #3498db;
    color: white;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-contact {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-contact a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9em;
}

.footer-contact a:hover {
    color: #16a085;
}

.footer-copyright {
    font-size: 0.85em;
    color: #bdc3c7;
}

@media (max-width: 768px) {
    .footer {
        position: static;
        padding: 12px 16px;
        box-shadow: none;
        margin-bottom: 80px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-contact {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== MOBILE NAVIGATION ==================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 10px 0;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    flex: 1;
}

.mobile-nav-btn .icon {
    font-size: 1.5em;
    margin-bottom: 4px;
}

.mobile-nav-btn.active {
    color: #16a085;
}

.mobile-nav-btn:hover {
    color: #16a085;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 80px; /* Space for mobile nav */
    }

    .main-nav {
        display: none !important; /* Hide regular nav on mobile */
    }

    .mobile-nav {
        display: flex;
    }

    header {
        padding: 20px;
    }

    .logo-section {
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .header-content {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 15px;
    }

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

    .data-table-container {
        overflow-x: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.export-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #16a085;
    position: relative;
    overflow: hidden;
}

.export-section::before {
    content: '📥';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.export-section h2 {
    color: #16a085;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.export-controls {
    position: relative;
    z-index: 1;
}

.export-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.export-select:focus {
    outline: none;
    border-color: #16a085;
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.btn-export {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-export::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-export:hover::before {
    width: 300px;
    height: 300px;
}

.btn-export:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-export:active {
    transform: translateY(-1px);
}

.btn-export-txt {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-export-excel {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-export-word {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.export-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #27ae60;
    margin-top: 20px;
}

.export-info p {
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.export-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.export-info li {
    padding: 8px 0;
    color: #555;
    font-size: 0.95em;
}

/* ==================== TABLE RESPONSIVE WRAPPER ==================== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #16a085;
    border-radius: 10px;
}

/* ==================== MOBILE OPTIMIZATION ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 140px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.5em !important;
    }
    
    h2 {
        font-size: 1.3em !important;
    }
    
    .subtitle {
        font-size: 0.9em !important;
    }
    
    .main-nav {
        gap: 8px;
        padding: 10px;
    }
    
    .nav-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.95em;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1em;
    }
    
    .btn, .btn-primary, .btn-success, .btn-warning, .btn-info, .btn-secondary, .btn-danger {
        padding: 14px 20px;
        font-size: 1em;
        width: 100%;
    }
    
    .export-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .btn-export {
        padding: 16px 20px;
        font-size: 1em;
        width: 100%;
    }
    
    .export-section h2 {
        font-size: 1.4em;
    }
    
    .export-info {
        padding: 15px;
    }
    
    .export-info p {
        font-size: 1em;
    }
    
    .export-info li {
        font-size: 0.9em;
        padding: 6px 0;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 1.1em;
    }
    
    .stat-card .stat-value {
        font-size: 1.8em;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-section .form-group {
        width: 100%;
    }
    
    .filter-section button {
        width: 100%;
        margin-top: 5px;
    }
    
    /* Mobile Table Optimization */
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }
    
    .table-card {
        overflow-x: visible;
        min-width: 100%;
    }
    
    .data-table {
        min-width: 800px;
        font-size: 0.85em;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    /* Card-based table for very small screens */
    .mobile-card-view {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
        padding-bottom: 160px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header-content > div {
        width: 100%;
    }
    
    .header-content > div:first-child {
        justify-content: center;
        text-align: center;
    }
    
    .header-content > div:last-child {
        flex-direction: column;
        gap: 10px;
    }
    
    .language-selector {
        width: 100%;
    }
    
    .language-selector select {
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }
    
    .btn-logout {
        padding: 8px 15px !important;
        font-size: 0.9em !important;
        white-space: nowrap;
    }
    
    h1 {
        font-size: 1.3em !important;
    }
    
    h2 {
        font-size: 1.1em !important;
    }
    
    .nav-btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .card {
        padding: 15px 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .btn-export {
        padding: 14px 18px;
        font-size: 0.95em;
    }
    
    .stat-card .stat-value {
        font-size: 1.5em;
    }
    
    .export-section::before {
        font-size: 80px;
    }
    
    /* Convert tables to card view on very small screens */
    .data-table {
        display: none;
    }
    
    .mobile-card-view {
        display: block;
    }
    
    .mobile-data-card {
        background: white;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-left: 4px solid #16a085;
    }
    
    .mobile-data-card .data-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-data-card .data-row:last-child {
        border-bottom: none;
    }
    
    .mobile-data-card .data-label {
        font-weight: 600;
        color: #555;
        font-size: 0.9em;
    }
    
    .mobile-data-card .data-value {
        color: #333;
        font-size: 0.9em;
        text-align: left;
    }
}

/* Employee table and action buttons */
.table-card {
    background: white;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.btn-delete {
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification animations */
.notification {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form input focus animations */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 160, 133, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(22, 160, 133, 0.1);
    }
}

/* Stagger animation for list items */
.data-table tbody tr {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

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

/* Portal-specific mobile styles */
@media (max-width: 768px) {
    .portal-nav {
        padding: 10px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .portal-container {
        flex-direction: column;
    }
    
    .portal-sidebar {
        width: 100%;
        position: relative;
    }
    
    .portal-main {
        width: 100%;
        padding: 15px;
    }
    
    .stats-grid-portal {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card-portal {
        padding: 15px;
    }
    
    .charts-row {
        flex-direction: column;
    }
    
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 0.8em;
        min-width: 700px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        font-size: 0.85em;
    }
}

/* Notification System */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 10px;
    margin: 0 10px;
    transition: transform 0.3s ease;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.bell-icon {
    font-size: 1.5em;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 400px;
    max-height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

.notification-header {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.btn-clear-notifications {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s ease;
}

.btn-clear-notifications:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease;
}

.notification-item:hover {
    background: #e9ecef;
    transform: translateX(-5px);
}

.notification-item.booking {
    border-left-color: #9b59b6;
}

.notification-item.attendance {
    border-left-color: #3498db;
}

.notification-item.leave {
    border-left-color: #f39c12;
}

.notification-item.mission {
    border-left-color: #e74c3c;
}

.notification-item.unread {
    background: #e8f5e9;
    font-weight: 600;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.notification-message {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 0.75em;
    color: #999;
}

/* Sub Navigation Tabs */
.sub-nav {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sub-nav-btn {
    padding: 12px 20px;
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-nav-btn:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.sub-nav-btn.active {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.3);
}

.staff-tab {
    display: none;
    animation: fadeIn 0.4s ease;
}

.staff-tab.active {
    display: block;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-modal {
    font-size: 35px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
    line-height: 1;
}

.close-modal:hover {
    transform: scale(1.2) rotate(90deg);
}

.modal form {
    padding: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

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

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

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal form {
        padding: 20px;
    }
    
    /* Mobile Notification Panel */
    .notification-panel {
        width: 95%;
        right: 2.5%;
        top: 70px;
        max-height: 70vh;
    }
    
    .notification-bell {
        padding: 8px;
        margin: 0 5px;
    }
    
    .bell-icon {
        font-size: 1.3em;
    }
    
    /* Mobile Sub Navigation */
    .sub-nav {
        gap: 5px;
        padding: 8px;
        justify-content: flex-start;
    }
    
    .sub-nav-btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }
    
    /* Mobile Tables */
    .table-wrapper {
        margin: 0 -10px;
    }
    
    .data-table {
        font-size: 0.75em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        font-size: 0.85em;
    }
    
    /* Mobile Action Buttons */
    .btn-edit,
    .btn-delete {
        padding: 6px 10px !important;
        font-size: 0.8em !important;
        margin: 2px !important;
    }
    
    /* Mobile Cards */
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .card h2 {
        font-size: 1.3em;
    }
    
    /* Mobile Form Rows */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Mobile Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card h3 {
        font-size: 1.5em;
    }
    
    .stat-card p {
        font-size: 0.85em;
    }
    
    /* Mobile Navigation */
    .main-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }
    
    /* Mobile Header */
    header h1 {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    /* Extra Small Screens */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sub-nav-btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .btn-edit,
    .btn-delete {
        display: block;
        width: 100%;
        margin: 3px 0 !important;
    }
}
