/* ============================================================
   Machine Takip – Frontend Portal Stilleri
   ============================================================ */

:root {
    --p-blue:      #0f3460;
    --p-blue-lt:   #1a6094;
    --p-accent:    #e94560;
    --p-green:     #10b981;
    --p-orange:    #f59e0b;
    --p-gray-50:   #f8fafc;
    --p-gray-100:  #f1f5f9;
    --p-gray-200:  #e2e8f0;
    --p-gray-400:  #94a3b8;
    --p-gray-600:  #475569;
    --p-gray-800:  #1e293b;
    --p-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --p-shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --p-radius:    10px;
    --p-radius-lg: 16px;
    --p-font:      'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.mt-portal { font-family: var(--p-font); color: var(--p-gray-800); min-height: 60vh; }

/* Portal Header */
.mt-portal-header {
    background: linear-gradient(135deg, var(--p-blue) 0%, var(--p-blue-lt) 100%);
    color: #fff; padding: 32px 40px; border-radius: var(--p-radius-lg) var(--p-radius-lg) 0 0;
    margin-bottom: 0;
}
.mt-portal-header__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.mt-portal-title { font-size: 26px; font-weight: 700; margin: 8px 0 0; display: flex; align-items: center; gap: 10px; }
.mt-portal-icon  { font-size: 28px; line-height: 1; }
.mt-portal-welcome { font-size: 14px; opacity: .8; margin: 6px 0 0; }
.mt-back-link { font-size: 13px; color: rgba(255,255,255,.75); text-decoration: none; transition: color .15s; display: inline-block; margin-bottom: 4px; }
.mt-back-link:hover { color: #fff; }

.mt-portal-body { background: var(--p-gray-50); padding: 32px 40px; border-radius: 0 0 var(--p-radius-lg) var(--p-radius-lg); }

/* Logout button */
.mt-logout-btn {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
    color: #fff; padding: 8px 16px; border-radius: var(--p-radius);
    font-size: 13px; text-decoration: none; transition: background .15s;
    white-space: nowrap; align-self: flex-start; margin-top: 8px;
}
.mt-logout-btn:hover { background: rgba(255,255,255,.25); }

/* Section header */
.mt-portal-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mt-portal-section-header h2 { font-size: 18px; font-weight: 700; color: var(--p-gray-800); margin: 0; }

/* Count badge */
.mt-count-badge {
    background: var(--p-blue); color: #fff;
    padding: 2px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
}

/* Empty state */
.mt-empty-state {
    text-align: center; padding: 60px 20px;
    background: #fff; border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow);
}
.mt-empty-state--sm { padding: 30px 20px; }
.mt-empty-icon { font-size: 52px; margin-bottom: 16px; line-height: 1; }
.mt-empty-state h3 { font-size: 18px; color: var(--p-gray-800); margin: 0 0 8px; }
.mt-empty-state p  { font-size: 14px; color: var(--p-gray-400); margin: 0; }

/* DataTables portal override */
.mt-dt-table.dataTable { background: #fff; border-radius: var(--p-radius-lg); box-shadow: var(--p-shadow); }
.mt-dt-table thead th { background: var(--p-blue) !important; color: #fff !important; border: none !important; font-size: 13px !important; padding: 14px 16px !important; }
.mt-dt-table tbody td { padding: 13px 16px !important; border-bottom: 1px solid var(--p-gray-100) !important; font-size: 14px; }
.mt-dt-table tbody tr:hover td { background: var(--p-gray-50) !important; }
table.dataTable.no-footer { border-bottom: none; }
.dataTables_wrapper .dataTables_filter input { border: 1.5px solid var(--p-gray-200); border-radius: var(--p-radius); padding: 7px 12px; font-size: 13px; }
.dataTables_wrapper .dataTables_length select { border: 1.5px solid var(--p-gray-200); border-radius: var(--p-radius); padding: 5px 8px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--p-blue) !important; border: none !important; color: #fff !important; border-radius: 6px; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--p-gray-100) !important; border: none !important; border-radius: 6px; }

/* Chassis display */
.mt-chassis { font-family: 'Courier New', monospace; font-weight: 700; font-size: 14px; color: var(--p-blue); background: var(--p-gray-100); padding: 3px 8px; border-radius: 4px; }

/* Status badges */
.mt-badge {
    display: inline-flex; align-items: center;
    padding: 4px 11px; border-radius: 20px;
    font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.mt-badge--in_stock { background: #d1fae5; color: #065f46; }
.mt-badge--sold     { background: #dbeafe; color: #1e40af; }
.mt-badge--rented   { background: #fef3c7; color: #92400e; }
.mt-badge--service  { background: #fce7f3; color: #9d174d; }
.mt-badge--ticket-open     { background: #fef3c7; color: #92400e; }
.mt-badge--ticket-resolved { background: #d1fae5; color: #065f46; }
.mt-badge--ticket-rejected { background: #fee2e2; color: #991b1b; }

.mt-text-success { color: var(--p-green); font-weight: 600; }
.mt-text-danger  { color: var(--p-accent); font-weight: 600; }

/* Portal Buttons */
.mt-portal-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--p-radius); border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; line-height: 1.4;
}
.mt-portal-btn--lg { padding: 12px 24px; font-size: 15px; }
.mt-portal-btn--primary { background: var(--p-blue); color: #fff; }
.mt-portal-btn--danger  { background: var(--p-accent); color: #fff; }
.mt-portal-btn--outline { background: transparent; color: var(--p-blue); border: 1.5px solid var(--p-blue); }
.mt-portal-btn--ghost   { background: var(--p-gray-100); color: var(--p-gray-600); }
.mt-portal-btn:hover    { opacity: .85; transform: translateY(-1px); }

/* Detail Card */
.mt-detail-card {
    background: #fff; border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow); margin-bottom: 28px; overflow: hidden;
}
.mt-detail-card__header {
    background: var(--p-blue); color: #fff; padding: 24px 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.mt-chassis-display { font-size: 28px; font-weight: 800; letter-spacing: 2px; font-family: 'Courier New', monospace; margin: 0; }
.mt-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.mt-detail-item {
    padding: 18px 24px; border-bottom: 1px solid var(--p-gray-100); border-right: 1px solid var(--p-gray-100);
}
.mt-detail-item--full { grid-column: 1 / -1; }
.mt-detail-item:nth-child(even) { border-right: none; }
.mt-detail-label { font-size: 11px; font-weight: 700; color: var(--p-gray-400); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.mt-detail-value { font-size: 15px; font-weight: 600; color: var(--p-gray-800); }

/* History & Tickets */
.mt-history-section { margin-bottom: 28px; }
.mt-section-title   { font-size: 18px; font-weight: 700; color: var(--p-gray-800); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.mt-tickets-list    { display: flex; flex-direction: column; gap: 12px; }
.mt-ticket-card {
    background: #fff; border-radius: var(--p-radius); box-shadow: var(--p-shadow);
    overflow: hidden; border-left: 4px solid var(--p-gray-200);
}
.mt-ticket-card--open     { border-color: var(--p-orange); }
.mt-ticket-card--resolved { border-color: var(--p-green); }
.mt-ticket-card--rejected { border-color: var(--p-accent); }
.mt-ticket-card__header   { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--p-gray-50); border-bottom: 1px solid var(--p-gray-100); }
.mt-ticket-title  { font-size: 14px; font-weight: 600; color: var(--p-gray-800); }
.mt-ticket-card__body  { padding: 16px 20px; }
.mt-ticket-desc        { font-size: 14px; color: var(--p-gray-600); line-height: 1.6; margin: 0; }
.mt-admin-response     { background: #eff6ff; border-radius: 6px; padding: 10px 14px; margin-top: 12px; }
.mt-admin-response p   { font-size: 13px; color: var(--p-gray-600); margin: 4px 0 0; line-height: 1.6; }
.mt-ticket-card__footer{ padding: 10px 20px; border-top: 1px solid var(--p-gray-100); display: flex; justify-content: space-between; font-size: 12px; color: var(--p-gray-400); }

/* Timeline */
.mt-timeline { position: relative; padding-left: 28px; }
.mt-timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--p-gray-200); }
.mt-timeline-item { position: relative; margin-bottom: 20px; }
.mt-timeline-item:last-child { margin-bottom: 0; }
.mt-timeline-dot { position: absolute; left: -28px; top: 6px; width: 12px; height: 12px; background: var(--p-blue); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--p-blue); }
.mt-timeline-content { background: #fff; border-radius: var(--p-radius); padding: 14px 18px; box-shadow: var(--p-shadow); }
.mt-timeline-meta { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--p-gray-400); }
.mt-timeline-note { font-size: 13px; color: var(--p-gray-800); font-weight: 500; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-timeline-text { font-size: 13px; color: var(--p-gray-600); margin: 4px 0 0; line-height: 1.6; }

/* Ticket Form */
.mt-ticket-form-wrap { max-width: 640px; }
.mt-form { background: #fff; border-radius: var(--p-radius-lg); padding: 32px; box-shadow: var(--p-shadow); }
.mt-field { margin-bottom: 20px; }
.mt-label { display: block; font-size: 13px; font-weight: 600; color: var(--p-gray-600); margin-bottom: 7px; }
.mt-req   { color: var(--p-accent); margin-left: 2px; }
.mt-input, .mt-select, .mt-textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--p-gray-200);
    border-radius: var(--p-radius); font-size: 14px; color: var(--p-gray-800);
    background: #fff; transition: border-color .15s, box-shadow .15s; font-family: var(--p-font);
    box-sizing: border-box;
}
.mt-input--lg, .mt-select--lg { padding: 12px 16px; font-size: 15px; }
.mt-textarea--lg { min-height: 120px; resize: vertical; }
.mt-input:focus, .mt-select:focus, .mt-textarea:focus {
    outline: none; border-color: var(--p-blue-lt);
    box-shadow: 0 0 0 3px rgba(26,96,148,.12);
}
.mt-form-footer { display: flex; gap: 12px; align-items: center; margin-top: 28px; flex-wrap: wrap; }

/* Alert */
.mt-alert {
    padding: 14px 18px; border-radius: var(--p-radius); margin-bottom: 20px;
    font-size: 14px; font-weight: 500; border-left: 4px solid transparent;
}
.mt-alert--success { background: #ecfdf5; border-color: var(--p-green); color: #065f46; }
.mt-alert--error   { background: #fef2f2; border-color: var(--p-accent); color: #991b1b; }

/* Responsive */
@media (max-width: 640px) {
    .mt-portal-header, .mt-portal-body { padding: 20px; }
    .mt-portal-header__inner { flex-direction: column; }
    .mt-detail-grid { grid-template-columns: 1fr; }
    .mt-detail-item { border-right: none; }
    .mt-portal-title { font-size: 20px; }
    .mt-chassis-display { font-size: 20px; }
}
