/* Luven Office - Yonetim Sistemi */

/* ========== Base ========== */
* { box-sizing: border-box; }
body {
    background: #f5f7fa;
    color: #1e293b;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== Animations ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Sidebar ========== */
.sidebar {
    background: #ffffff;
    transition: width 0.3s ease;
    box-shadow: 1px 0 0 #e2e8f0;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    color: #64748b;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    font-weight: 500;
}
.sidebar-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.sidebar-link.active {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
}

/* ========== Table ========== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.data-table thead th:first-child { border-radius: 0.5rem 0 0 0; }
.data-table thead th:last-child { border-radius: 0 0.5rem 0 0; }

.data-table tbody td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}
.data-table tbody tr {
    transition: all 0.15s ease;
    cursor: pointer;
    animation: fadeInUp 0.25s ease backwards;
}
.data-table tbody tr:nth-child(1) { animation-delay: 0.01s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.04s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.05s; }

.data-table tbody tr:hover {
    background: #fef2f2;
}
.data-table tbody tr:hover td {
    color: #1e293b;
}
.data-table tbody tr:hover td:first-child {
    color: #dc2626;
}
.data-table tbody tr:active {
    background: #fee2e2;
}

/* ========== Notes Popup (Body Level) ========== */
.notes-popup {
    position: fixed;
    z-index: 100;
    min-width: 200px;
    max-width: 350px;
    padding: 0.625rem 0.875rem;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.notes-popup.show {
    opacity: 1;
    transform: translateY(0);
}

/* Notes indicator icon */
.notes-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    color: #f59e0b;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ========== Status Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-active {
    background: #dcfce7;
    color: #16a34a;
}
.badge-passive {
    background: #fee2e2;
    color: #dc2626;
}
.badge-warning {
    background: #fef3c7;
    color: #d97706;
}
.badge-expired {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
}
.badge-monthly {
    background: #dbeafe;
    color: #2563eb;
}
.badge-yearly {
    background: #f3e8ff;
    color: #7c3aed;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ========== Stat Cards ========== */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.3s ease backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }

.stat-card:hover {
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}
.stat-card:active {
    transform: translateY(0);
}
.stat-card.stat-active-filter {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ========== File Upload Area ========== */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}
.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #dc2626;
    background: #fef2f2;
}

/* ========== Form Inputs ========== */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #1e293b;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}
.form-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.form-input::placeholder {
    color: #9ca3af;
}
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* ========== Toast Notification ========== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1);
}
.toast-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

/* ========== Filter Bar ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #dc2626;
    animation: slideDown 0.2s ease;
}
.filter-bar button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: #ffffff;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    color: #dc2626;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.filter-bar button:hover {
    background: #dc2626;
    color: #fff;
}

/* ========== Action Buttons ========== */
.action-btn {
    padding: 0.35rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    opacity: 0.4;
}
.data-table tbody tr:hover .action-btn {
    opacity: 1;
}
.action-btn:hover {
    transform: scale(1.15);
}

/* ========== Table Container ========== */
.table-container {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ========== Price Cell ========== */
.price-cell {
    color: #1e293b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: 280px !important;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 35;
    }
    .sidebar.open + .sidebar-overlay {
        display: block;
    }
    .data-table tbody td {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ========== Company Panel (Slide-Over) ========== */
.company-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.company-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}
.company-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80%;
    max-width: 900px;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 51;
}
.company-panel-overlay.active .company-panel {
    transform: translateX(0);
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
}
.panel-back-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #64748b;
    transition: all 0.15s ease;
}
.panel-back-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Panel Tabs */
.panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 1.5rem;
    background: #f8fafc;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tab {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.panel-tab:hover {
    color: #1e293b;
}
.panel-tab.active {
    color: #dc2626;
    border-bottom-color: #dc2626;
    font-weight: 600;
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
}

/* ========== Inline Editing ========== */
.editable-field {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
    position: relative;
}
.editable-field:hover {
    background: #f8fafc;
}
.editable-field:hover .editable-icon {
    opacity: 1;
}
.editable-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
}
.editable-value {
    font-size: 0.875rem;
    color: #1e293b;
}
.editable-icon {
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
    color: #94a3b8;
}
.editable-input .form-input {
    animation: fadeIn 0.15s ease;
}
.field-saved {
    animation: fieldSaved 1s ease;
}
@keyframes fieldSaved {
    0% { background: #dcfce7; }
    100% { background: transparent; }
}

/* ========== Renewal Stepper ========== */
.renewal-stepper {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 0;
    overflow-x: auto;
}
.renewal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    min-width: 5rem;
}
.step-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
}
.step-line {
    flex: 1;
    height: 2px;
    background: #d1d5db;
    min-width: 1.5rem;
    margin-top: 0.75rem;
    flex-shrink: 0;
}
.step-done .step-dot {
    background: #16a34a;
    border-color: #16a34a;
}
.step-done .step-dot::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
}
.step-done .step-label { color: #16a34a; }
.step-done + .step-line { background: #16a34a; }
.step-current .step-dot {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}
.step-current .step-dot::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
}
.step-current .step-label {
    color: #dc2626;
    font-weight: 700;
}
.step-rejected .step-dot {
    background: #fee2e2;
    border-color: #dc2626;
}
.step-rejected .step-label { color: #dc2626; }

/* ========== Panel Actions Dropdown ========== */
.panel-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}
.panel-actions-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.panel-actions-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: #475569;
    transition: all 0.1s;
    text-align: left;
}
.panel-actions-menu button:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.panel-actions-menu button.text-red-600:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ========== Mobile Responsive (Panel) ========== */
@media (max-width: 768px) {
    .company-panel {
        width: 100%;
        max-width: none;
    }
    .panel-tabs {
        padding: 0 1rem;
    }
    .panel-header {
        padding: 0.75rem 1rem;
    }
    .renewal-stepper {
        padding: 0.5rem 0;
    }
}

/* ========== Selection ========== */
::selection {
    background: rgba(220, 38, 38, 0.15);
    color: #1e293b;
}
