:root {
    /* Renkler */
    --bg: #0a0f1a;
    --bg-sidebar: #080c14;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);

    --primary: #6ee7ff;
    --primary-glow: rgba(110, 231, 255, 0.3);
    --accent: #a78bfa;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;

    /* Sidebar genişliği */
    --sidebar-width: 260px;

    /* Efektler */
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(110, 231, 255, 0.15);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 231, 255, 0.3);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 231, 255, 0.15) transparent;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 800px 600px at 20% 20%, rgba(110, 231, 255, 0.15), transparent 50%),
        radial-gradient(ellipse 600px 500px at 80% 80%, rgba(167, 139, 250, 0.12), transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(0, 4%);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 20px var(--primary-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
}

.brand-text span {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header {
    text-align: center;
    margin: 40px 0 32px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input,
.form-control {
    width: 100%;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 16px 48px 16px 18px;
    /* Extra padding on right for arrow */
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;

    /* Custom Chevron Icon */
    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='white' 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;
    background-size: 16px;
}

select.form-control:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

select.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: rgba(0, 0, 0, 0.5);
}

select.form-control option {
    background-color: #1a1a1a;
    /* Dark background for options */
    color: #ffffff;
    padding: 12px;
}

.password-wrapper {
    position: relative;
}

.btn-show-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.btn-show-password:hover {
    color: var(--text);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-size: 14px;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-checkbox:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #0a0f1a;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-block {
    width: 100%;
}

/* Alert */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

.alert.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .brand {
    justify-content: flex-start;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(110, 231, 255, 0.15), rgba(167, 139, 250, 0.1));
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0a0f1a;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-logout:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
    animation: fadeInUp 0.4s ease;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 15px;
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.25s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.3s;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(110, 231, 255, 0.2);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.quick-action .icon {
    font-size: 28px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.1), rgba(167, 139, 250, 0.1));
    border-radius: 14px;
}

.quick-action h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.quick-action p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Content Cards */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

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

.content-card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

td {
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-icon.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

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

.toast-success {
    background: var(--success);
    color: #0a0f1a;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: linear-gradient(180deg, rgba(20, 28, 45, 0.98) 0%, rgba(15, 22, 38, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: modalSlide 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header .icon {
    font-size: 24px;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.modal-body {
    margin-bottom: 28px;
}

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

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.modal-body .form-group label .required {
    color: var(--danger);
}

.modal-body .form-input {
    padding: 14px 16px;
    font-size: 15px;
}

/* Auto-generated code input */
.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn .form-input {
    flex: 1;
}

.btn-generate {
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-generate:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

/* Form grid */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Select styling */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236ee7ff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-footer .btn {
    flex: 1;
    padding: 14px 20px;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .login-card {
        padding: 32px 24px;
    }

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

    .modal-card {
        padding: 24px;
    }
}

/* Sub-section for nested forms */
.sub-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease-out;
}

.sub-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

/* ==================== SHIPMENT TABS ==================== */
.shipment-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.shipment-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.shipment-tab:hover {
    background: var(--bg-card-hover);
    border-color: rgba(110, 231, 255, 0.3);
    color: var(--text);
}

.shipment-tab.active {
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(167, 139, 250, 0.1));
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(110, 231, 255, 0.2);
}

.shipment-tab .tab-icon {
    font-size: 18px;
}

.shipment-tab .tab-label {
    font-weight: 600;
}

.shipment-tab .tab-badge {
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 8px;
}

.shipment-tab.active .tab-badge {
    background: var(--primary);
    color: #0a0f1a;
}

.shipment-tab .tab-badge.warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.shipment-tab.active .tab-badge.warning {
    background: var(--warning);
    color: #0a0f1a;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(110, 231, 255, 0.15);
    color: var(--primary);
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Responsive for shipment tabs */
@media (max-width: 768px) {
    .shipment-tabs {
        flex-direction: column;
    }

    .shipment-tab {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== SHIPMENT TYPE GRID (MODAL) ==================== */
.shipment-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.shipment-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.shipment-type-option:hover {
    background: var(--bg-card-hover);
    border-color: rgba(110, 231, 255, 0.3);
}

.shipment-type-option.active {
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(167, 139, 250, 0.1));
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(110, 231, 255, 0.2);
}

.shipment-type-option .type-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.shipment-type-option .type-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.shipment-type-option.active .type-label {
    color: var(--primary);
}

/* Textarea styling */
textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

/* Responsive for shipment type grid */
@media (max-width: 480px) {
    .shipment-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== SCROLLABLE MODAL ==================== */
.modal-scrollable {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-scrollable form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-scrollable .modal-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
    margin-right: -8px;
    margin-bottom: 0;
}

/* Styled scrollbar for modal */
.modal-scrollable .modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-scrollable .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-scrollable .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-scrollable .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox scrollbar */
.modal-scrollable .modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

/* ==================== QUICK ADD BUTTON ==================== */
.btn-quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 10px;
    background: transparent;
    border: 1px dashed rgba(110, 231, 255, 0.4);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-quick-add:hover {
    background: rgba(110, 231, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ==================== STYLED SELECT DROPDOWN ==================== */
.styled-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236ee7ff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.styled-select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.1);
}

.styled-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.15);
    outline: none;
}

.styled-select option {
    background: var(--bg-dark);
    color: var(--text);
    padding: 12px;
}

/* ==================== STYLED DATE INPUT ==================== */
.styled-date {
    cursor: pointer;
    color-scheme: dark;
}

.styled-date::-webkit-calendar-picker-indicator {
    filter: invert(80%) sepia(50%) saturate(500%) hue-rotate(160deg);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.styled-date::-webkit-calendar-picker-indicator:hover {
    background: rgba(110, 231, 255, 0.2);
}

.styled-date:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.1);
}

.styled-date:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.15);
    outline: none;
}

/* ==================== INPUT GROUP ==================== */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-input {
    flex: 1;
}

.input-group .btn {
    padding: 0 16px;
    white-space: nowrap;
}

/* ==================== LUNE AI CHAT ==================== */
.chat-page {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.chat-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.chat-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
}

.chat-head {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: var(--bg-card-hover);
}

.chat-item.active {
    background: rgba(110, 231, 255, 0.1);
    border-left: 3px solid var(--primary);
}

.chat-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.chat-body-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-row {
    display: flex;
    width: 100%;
}

.msg-row.user {
    justify-content: flex-start;
}

.msg-row.assistant {
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-row.user .msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.msg-row.user .msg-meta {
    font-size: 11px;
    margin-bottom: 4px;
    color: var(--primary);
}

.msg-row.assistant .msg-bubble {
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(167, 139, 250, 0.15));
    border: 1px solid rgba(110, 231, 255, 0.3);
    border-bottom-right-radius: 2px;
    color: #fff;
}

.msg-row.assistant .msg-meta {
    font-size: 11px;
    margin-bottom: 4px;
    color: var(--accent);
    text-align: right;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.5;
}

.chat-empty .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    vertical-align: middle;
}

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

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

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

input:checked+.slider {
    background-color: var(--success);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

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

.ai-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.ai-status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

input:checked~.ai-status-text {
    color: var(--success);
}

/* ==================== NOTES PAGE ==================== */
.notes-page {
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
}

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

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

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 250px;
    position: relative;
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
    background: var(--bg-card-hover);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.note-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    flex: 1;
    margin-right: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.note-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-work {
    background: rgba(110, 231, 255, 0.15);
    color: var(--primary);
}

.badge-personal {
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent);
}

.badge-urgent {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
}

.note-content {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    white-space: pre-line;
}

.note-footer {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.note-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: 0.2s;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.btn-icon-sm {
    padding: 4px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-icon-sm:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon-sm.delete:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

/* Modal Styles override or extension */
.modal-content textarea {
    min-height: 150px;
    resize: vertical;
}

.recurrence-icon {
    margin-left: 6px;
    color: var(--success);
}

/* Fix for Date/Time Input Icons in Dark Mode */
::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
}
/* ==================== CUSTOM DROPDOWN ==================== */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    font-size: 16px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.3); /* Glass effect */
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.custom-select-trigger:after {
    content: '';
    width: 16px; 
    height: 16px;
    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='white' 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: center;
    transition: transform 0.3s ease;
}

.custom-select.open .custom-select-trigger {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select.open .custom-select-trigger:after {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--border);
    border-top: none; 
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    background: rgba(20, 20, 20, 0.95); /* Deep dark background */
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: block;
    padding: 12px 18px;
    font-size: 15px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08); /* Hover highlight */
    padding-left: 22px; /* Slight slide effect */
}

.custom-option.selected {
    color: var(--primary);
    background: rgba(110, 231, 255, 0.1);
    font-weight: 600;
}

/* Custom Scrollbar for Options */
.custom-options::-webkit-scrollbar {
    width: 6px;
}
.custom-options::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.custom-options::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Dropup Support */
.custom-select.drop-up .custom-options {
    top: auto;
    bottom: 100%;
    border-top: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transform: translateY(10px);
}

.custom-select.drop-up.open .custom-options {
    transform: translateY(0);
}

.custom-select.drop-up.open .custom-select-trigger {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-bottom: 1px solid var(--border); /* Restore bottom border */
    border-top-color: var(--primary); /* Highlight top */
}
