/* =====================================================
   File Manager — Osmaniye Tarzı Arşiv Görünümü
   ===================================================== */

* { box-sizing: border-box; }

body.fm-body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   Header
   ===================================================== */
.fm-header {
    background: linear-gradient(135deg, #16304f 0%, #1e3a5f 55%, #1a3358 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 20px rgba(0,0,0,.32);
}
.fm-header::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #b8922e 0%, #ddb84a 40%, #e8cc72 60%, #c8a43e 100%);
}

.fm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fm-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    transition: opacity .18s;
}
.fm-brand:hover { opacity: .85; color: #fff; }

.fm-brand-icon {
    height: 80px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,.18);
}
.fm-brand-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
    display: block;
}

.fm-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.fm-brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
}

.fm-brand-sub {
    font-size: 10.5px;
    opacity: .55;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 500;
    margin-top: 1px;
}

.fm-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,.12);
}

/* =====================================================
   Container
   ===================================================== */
.fm-container {
    max-width: 1200px;
    width: 100%;
    margin: 24px auto;
    padding: 0 20px;
    flex: 1;
}

/* =====================================================
   Breadcrumb
   ===================================================== */
.fm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 13px;
    margin-bottom: 10px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #dde2e9;
    border-radius: 5px;
}

.fm-bc-sep {
    color: #adb5bd;
    font-size: 10px;
    padding: 0 4px;
}

.fm-bc-link {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
}

.fm-bc-link:hover {
    text-decoration: underline;
    color: #c8102e;
}

.fm-bc-current {
    color: #6c757d;
    font-weight: 500;
}

/* =====================================================
   Toolbar
   ===================================================== */
.fm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    background: #f8f9fa;
    border: 1px solid #dde2e9;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin-top: 6px;
}

.fm-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fm-btn-up {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12.5px;
    color: #495057;
    text-decoration: none;
    transition: all .15s ease;
}

.fm-btn-up:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.fm-btn-upload {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: #1e3a5f;
    border-radius: 4px;
    font-size: 12.5px;
    color: #fff;
    text-decoration: none;
    transition: background .15s ease;
}

.fm-btn-upload:hover {
    background: #142843;
    color: #fff;
}

.fm-item-count {
    font-size: 12px;
    color: #6c757d;
}

.fm-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fm-search-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
}

.fm-year-form {
    margin: 0;
}

.fm-year-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fm-year-icon {
    position: absolute;
    left: 10px;
    color: #adb5bd;
    font-size: 13px;
    pointer-events: none;
}

.fm-year-select {
    min-width: 148px;
    height: 33px;
    padding: 6px 26px 6px 30px;
    border: 1px solid #dde2e8;
    border-radius: 20px;
    font-size: 13px;
    background-color: #f8f9fa;
    color: #495057;
    outline: none;
}

.fm-year-select:focus {
    border-color: #1e3a5f;
    background: #fff;
}

/* =====================================================
   Search
   ===================================================== */
.fm-search-form { flex: 1; max-width: 420px; }

.fm-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fm-search-icon {
    position: absolute;
    left: 10px;
    color: #adb5bd;
    font-size: 14px;
    pointer-events: none;
}

.fm-search-input {
    width: 100%;
    padding: 6px 34px 6px 32px;
    border: 1px solid #dde2e8;
    border-radius: 20px;
    font-size: 13px;
    background: #f8f9fa;
    outline: none;
    transition: border-color .2s, background .2s;
}

.fm-search-input:focus {
    border-color: #1e3a5f;
    background: #fff;
}

.fm-search-clear {
    position: absolute;
    right: 10px;
    color: #adb5bd;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
}

.fm-search-clear:hover { color: #dc3545; }

@media (max-width: 768px) {
    .fm-search-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .fm-year-form,
    .fm-search-form {
        width: 100%;
        max-width: none;
    }
}

/* =====================================================
   File List Table
   ===================================================== */
.fm-table-wrap {
    background: #fff;
    border: 1px solid #dde2e9;
    border-radius: 0 0 5px 5px;
    overflow-x: auto;
}

table.file-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.file-list thead th {
    background: #f4f5f7;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    border-bottom: 2px solid #dde2e9;
    white-space: nowrap;
}

table.file-list tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background .1s ease;
}

table.file-list tbody tr:last-child {
    border-bottom: none;
}

table.file-list tbody tr:hover {
    background: #f5f7fa;
}

/* Column widths */
.th-icon  { width: 40px; }
.th-name  { min-width: 220px; }
.th-type  { width: 80px; }
.th-size  { width: 110px; }
.th-date  { width: 100px; }
.th-count { width: 110px; text-align: center; }
.td-count { text-align: center; color: #6c757d; font-size: 13px; }
.th-actions { width: 90px; text-align: center; }
.td-actions { text-align: center; }

table.file-list td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* Icon column */
.td-icon {
    text-align: center;
    padding: 8px 10px;
}

.fm-folder-icon {
    font-size: 22px;
    color: #e8a000;
}

.fm-pdf-icon {
    font-size: 20px;
    color: #c8102e;
}

/* Directory rows */
tr.directory .td-name {
    font-weight: 600;
}

tr.directory .td-name[colspan="2"] {
    padding-left: 10px;
}

.fm-dir-link {
    color: #1e3a5f;
    text-decoration: none;
    font-size: 13.5px;
}

.fm-dir-link:hover {
    color: #c8102e;
    text-decoration: underline;
}

/* File rows */
.fm-file-link {
    color: #2c3e50;
    text-decoration: none;
    font-size: 13.5px;
}

.fm-file-link:hover {
    color: #1e3a5f;
    text-decoration: underline;
}

.fm-file-locked {
    color: #868e96;
    font-size: 13.5px;
    cursor: default;
}

/* Restricted file row */
tr.file-restricted {
    background: #fafafa;
}

tr.file-restricted .td-icon .fm-pdf-icon {
    color: #adb5bd;
}

/* Type / Size / Date columns */
.td-type,
.td-size,
.td-date {
    color: #6c757d;
    font-size: 12.5px;
    white-space: nowrap;
}

/* Actions */
.td-actions {
    white-space: nowrap;
}

.fm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: #495057;
    background: #f0f2f5;
    text-decoration: none;
    font-size: 14px;
    margin-right: 2px;
    transition: all .15s ease;
}

.fm-action-btn:hover {
    background: #1e3a5f;
    color: #fff;
}

.fm-action-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #ced4da;
    font-size: 14px;
}

/* Empty state */
.fm-empty {
    text-align: center;
    padding: 52px 20px;
    color: #adb5bd;
}

.fm-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.fm-empty span {
    font-size: 14px;
}

/* =====================================================
   Footer
   ===================================================== */
.fm-footer {
    background: linear-gradient(135deg, #111c2e 0%, #172843 100%);
    color: rgba(255,255,255,.55);
    font-size: 12px;
    margin-top: auto;
    border-top: 3px solid #c8a43e;
}
.fm-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px 10px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 28px;
}
.fm-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.fm-footer-brand-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.88);
    font-size: 13.5px;
}
.fm-footer-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
}
.fm-footer-tagline {
    font-size: 10.5px;
    color: rgba(255,255,255,.35);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.fm-footer-sep {
    width: 1px;
    height: 44px;
    background: rgba(255,255,255,.1);
}
.fm-footer-copy {
    text-align: right;
}
.fm-footer-copy strong {
    display: block;
    color: rgba(255,255,255,.7);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
}
.fm-footer-copy span {
    font-size: 11px;
    color: rgba(255,255,255,.38);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 600px) {
    .fm-container { padding: 0 10px; margin: 12px auto; }
    .fm-header-inner { padding: 0 12px; height: 56px; }
    .fm-brand-icon { padding-right: 10px; }
    .fm-brand-logo { height: 50px; }
    .fm-brand-title { font-size: 13px; }
    .fm-brand-sub { display: block; }
    .fm-header-right { padding-left: 12px; }
    .fm-footer-inner { grid-template-columns: 1fr; gap: 12px; padding: 16px 16px 14px; }
    .fm-footer-sep { display: none; }
    .fm-footer-copy { text-align: left; }
    .th-type, .td-type,
    .th-date, .td-date,
    .th-count, .td-count { display: none; }
    table.file-list thead th,
    table.file-list td { padding: 8px 10px; }
}
