/* =====================================================
   ADMIN DASHBOARD STYLES (SYNCED FROM DESKTOP)
   ===================================================== */

.admin-body {
    background: var(--bg-secondary);
    min-height: 100vh;
    padding-top: 100px;
}

/* =====================================================
   THEME & RTL OVERRIDES FOR INPUTS
   ===================================================== */
html[data-theme="light"] .admin-input,
html[data-theme="light"] .login-box input,
html[data-theme="light"] select.admin-input {
    color: #000000 !important;
}

html[data-theme="dark"] .admin-input,
html[data-theme="dark"] .login-box input {
    color: #ffffff !important;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(10, 25, 47, 0.95), var(--navy-dark));
    backdrop-filter: blur(10px);
    z-index: 9999;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 48px;
    border-radius: 30px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.login-box h2 {
    margin-bottom: 32px;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
}

.login-form-group {
    position: relative;
    margin-bottom: 24px;
}

.login-form-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color var(--transition);
}

.login-box input {
    width: 100%;
    padding: 16px 16px 16px 60px;
    border: 2px solid var(--gold);
    border-radius: 12px;
    background: var(--input-bg);
    color: white !important;
    font-size: 1.05rem;
    outline: none;
    transition: all var(--transition);
}

.login-box input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    background: var(--bg-card);
}

/* Admin Layout */
.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 5px;
    flex-wrap: wrap;
    gap: 15px;
}

[lang="ar"] .admin-list-header {
    flex-direction: row-reverse;
}

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

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--navy), var(--gold));
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

body.rtl .admin-table th {
    text-align: right;
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

/* Modern Form Styling for Admin */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.form-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-container i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color var(--transition);
    z-index: 2;
}

.admin-input {
    width: 100%;
    padding: 14px 16px 14px 60px;
    border: 2px solid var(--gold);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition);
}

.admin-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    background: var(--bg-card);
}

.form-input-container:focus-within i {
    color: var(--navy);
}

select.admin-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

select.admin-input option {
    background: var(--bg-card);
    color: var(--text-primary);
}

@media (max-width: 992px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (max-width: 1200px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Layouts */
@media (max-width: 768px) {
    .navbar .nav-inner {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .navbar .logo {
        font-size: 1.2rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.booking-confirmed {
    background: rgba(201, 160, 67, 0.1);
    color: var(--gold);
    border: 1px solid rgba(201, 160, 67, 0.2);
}

.status-badge.pickup-scheduled {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.status-badge.packing-completed {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.status-badge.loaded-in-container {
    background: rgba(0, 150, 136, 0.1);
    color: #009688;
    border: 1px solid rgba(0, 150, 136, 0.2);
}

.status-badge.ship-departed {
    background: rgba(3, 169, 244, 0.1);
    color: #03a9f4;
    border: 1px solid rgba(3, 169, 244, 0.2);
}

.status-badge.in-transit {
    background: rgba(25, 118, 210, 0.1);
    color: #1976d2;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.status-badge.arrived-at-port {
    background: rgba(121, 85, 72, 0.1);
    color: #795548;
    border: 1px solid rgba(121, 85, 72, 0.2);
}

.status-badge.customs-clearance {
    background: rgba(96, 125, 139, 0.1);
    color: #607d8b;
    border: 1px solid rgba(96, 125, 139, 0.2);
}

.status-badge.delivered {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.status-badge.ready-to-load {
    background: rgba(201, 160, 67, 0.1);
    color: var(--gold);
    border: 1px solid rgba(201, 160, 67, 0.2);
}

.status-badge.loaded-on-vessel {
    background: rgba(0, 150, 136, 0.1);
    color: #009688;
    border: 1px solid rgba(0, 150, 136, 0.2);
}

.status-badge.departed {
    background: rgba(25, 118, 210, 0.1);
    color: #1976d2;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.status-badge.transbordement-discharged {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.status-badge.transbordement-loaded {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.status-badge.arrived {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

@media (max-width: 768px) {

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table th,
    .admin-table td,
    .admin-table tr {
        display: block;
    }

    .admin-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .admin-table tr {
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
        background: var(--bg-card);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .admin-table td {
        border: none;
        padding: 8px 0;
        padding-left: 50%;
        position: relative;
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-right: 8px;
    }

    body.rtl .admin-table td {
        text-align: left;
        flex-direction: row-reverse;
    }

    body.rtl .admin-table td::before {
        margin-right: 0;
        margin-left: 8px;
    }

    .admin-table td:last-child {
        border-top: 1px solid var(--border);
        margin-top: 12px;
        padding-top: 16px;
        justify-content: center;
    }

    .admin-table td:last-child::before {
        display: none;
    }
}

/* Removed duplicate admin-list-header */

.admin-search-container {
    max-width: 250px;
    width: 100%;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-body {
        padding-top: 80px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .admin-header .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .admin-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-search-container {
        max-width: 100%;
    }

    .login-box {
        width: 100%;
        margin: 0 10px;
        padding: 40px 20px;
    }

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

    .navbar .nav-inner {
        padding: 10px 15px;
    }
}

/* RTL Support */
body.rtl .login-box input {
    padding: 16px 60px 16px 16px;
}

body.rtl .login-form-group i {
    left: auto;
    right: 16px;
}

body.rtl .admin-input {
    padding: 14px 60px 14px 16px;
}

body.rtl .form-input-container i {
    left: auto;
    right: 16px;
}

/* MODAL STYLES */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 20px;
}

.modal-box {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

[dir="rtl"] .modal-close {
    right: auto;
    left: 20px;
}

.nav-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

@media (max-width: 768px) {
    .modal-box {
        padding: 25px;
        width: 100%;
    }

    .modal-box h2 {
        font-size: 1.5rem;
    }
}

/* TAB STYLES */
.admin-tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.admin-tab-btn:hover {
    background: rgba(201, 160, 67, 0.05);
    color: var(--gold);
}

.admin-tab-btn.active {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 4px 12px rgba(27, 58, 107, 0.2);
}

[dir="rtl"] .admin-tab-btn i {
    margin-left: 8px;
    margin-right: 0;
}

@media (max-width: 768px) {
    .admin-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .admin-tab-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* TOAST SYSTEM */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease forwards;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid #25D366;
}

.toast.error {
    border-left: 4px solid #ff4d4d;
}

[dir="rtl"] .toast {
    animation-name: slideInLeft;
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

[dir="rtl"] select.admin-input {
    background-position: left 16px center;
    padding-left: 48px;
    padding-right: 16px;
}

[dir="rtl"] .admin-table th {
    text-align: right;
}

[dir="rtl"] .admin-table td {
    text-align: right;
}

[dir="rtl"] .admin-table td::before {
    margin-right: 0;
    margin-left: 8px;
}