:root {
    --kmtso-blue: #1e5aa8;
    --kmtso-dark: #1f2937;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background: #f0f4f8;
}

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-brand-panel {
    flex: 1;
    background: linear-gradient(160deg, #1e5aa8 0%, #0f3460 55%, #1f2937 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-brand-logo img {
    max-height: 80px;
    margin-bottom: 24px;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 24px;
}

.login-brand-panel h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}

.login-brand-subtitle {
    font-size: 1rem;
    opacity: 0.88;
    margin-bottom: 32px;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-features li {
    padding: 8px 0;
    opacity: 0.92;
    font-size: 0.95rem;
}

.login-features i {
    color: #7dd3fc;
    margin-right: 10px;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    opacity: 0.7;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #f4f6f9;
}

.login-form-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.login-form-header p {
    color: #6b7280;
    margin-bottom: 28px;
}

.login-input-group .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.login-input-group .form-control {
    border-color: #e2e8f0;
    padding: 10px 14px;
}

.login-input-group .form-control:focus {
    border-color: var(--kmtso-blue);
    box-shadow: 0 0 0 0.2rem rgba(30, 90, 168, 0.15);
}

.btn-login-submit {
    background: var(--kmtso-blue);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.15s;
}

.btn-login-submit:hover {
    background: #164a8a;
    color: #fff;
    transform: translateY(-1px);
}

.login-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.login-remember-check {
    user-select: none;
}

.login-remember-check .form-check-label {
    color: #495057;
    cursor: pointer;
}

.logout-btn {
    border-color: rgba(255,255,255,0.5) !important;
    color: #fff !important;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.15) !important;
    border-color: #fff !important;
    color: #fff !important;
}

.main-sidebar .sidebar {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 57px);
}

.main-sidebar .sidebar nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-logout {
    border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 991px) {
    .login-wrapper {
        flex-direction: column;
    }
    .login-brand-panel {
        padding: 32px 24px;
    }
    .login-brand-panel h1 {
        font-size: 1.2rem;
    }
    .login-features {
        display: none;
    }
    .login-form-box {
        padding: 28px 24px;
    }
}

.main-header {
    background: var(--kmtso-blue) !important;
    border-bottom: none;
}

.main-header .navbar-nav .nav-link,
.main-header .navbar-nav .nav-link i {
    color: rgba(255, 255, 255, 0.92) !important;
}

.main-sidebar {
    background: var(--kmtso-dark) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.content-wrapper {
    background: #f4f6f9;
}

.card-kmtso {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table-kmtso thead th {
    background: #eef2f7;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 0;
}

.table-kmtso tbody td {
    vertical-align: middle;
}

.table-karar-liste {
    table-layout: fixed;
    width: 100%;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table-karar-liste thead th {
    white-space: nowrap;
}

.table-karar-liste .col-tarih {
    width: 92px;
}

.table-karar-liste .col-top-no,
.table-karar-liste .col-karar-no {
    width: 56px;
    text-align: center;
}

.table-karar-liste .col-tur {
    width: 68px;
    text-align: center;
}

.table-karar-liste .col-anahtar {
    width: 120px;
}

.table-karar-liste .col-durum {
    width: 108px;
}

.table-karar-liste .col-atanan {
    width: 110px;
}

.table-karar-liste .col-islem {
    width: 44px;
    text-align: center;
}

.table-karar-liste .cell-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
}

.table-karar-liste .badge-tur-compact {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.35em 0.45em;
    white-space: nowrap;
}

.table-karar-liste .badge-durum {
    font-size: 0.72rem;
    white-space: nowrap;
}

.karar-liste-filters {
    border-bottom: 1px solid #eef2f7;
}

.dashboard-stat-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.dashboard-stat-item {
    flex: 1 1 0;
    min-width: 130px;
}

.dashboard-stat-row .small-box {
    margin-bottom: 0;
    height: 100%;
}

.dashboard-stat-row .small-box .inner h3 {
    font-size: 1.75rem;
}

.dashboard-stat-row .small-box .inner p {
    font-size: 0.78rem;
    line-height: 1.25;
    margin-bottom: 0;
}

.dashboard-stat-row .small-box .icon {
    font-size: 56px;
    top: 8px;
}

.dashboard-panel-list .list-group-item {
    padding-left: 0;
    padding-right: 0;
}

.dashboard-panel-list .list-group-item a {
    color: inherit;
    text-decoration: none;
}

.dashboard-panel-list .list-group-item a:hover {
    color: var(--kmtso-blue);
}

.user-avatar-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    vertical-align: middle;
}

.user-avatar-wrap img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 0.72rem;
}

.user-avatar-md {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.8rem;
}

.user-avatar-lg {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    font-size: 1.5rem;
}

.user-avatar-initials {
    background: var(--kmtso-blue);
    color: #fff;
    font-weight: 600;
}

.user-avatar-preview-wrap {
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #eef2f7;
}

.user-avatar-preview-wrap .user-avatar-wrap {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.navbar .user-avatar-wrap {
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.karar-toplanti-readonly .detail-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.karar-toplanti-readonly .detail-value {
    font-size: 0.95rem;
}

.karar-liste-filters .form-label-sm {
    font-size: 0.75rem;
    color: #6c757d;
}

.table-karar-liste .sortable-th {
    white-space: nowrap;
}

.table-karar-liste .table-sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.table-karar-liste .table-sort-link:hover {
    color: var(--kmtso-blue);
}

.table-karar-liste .sort-icon-active {
    color: var(--kmtso-blue);
    font-size: 0.75rem;
}

.table-karar-liste .sort-icon-idle {
    color: #adb5bd;
    font-size: 0.7rem;
    opacity: 0.7;
}

.table-karar-liste .sortable-th:hover .sort-icon-idle {
    opacity: 1;
}

.navbar .user-menu > .nav-link {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.karar-modal-readonly {
    background-color: #f8fafc !important;
    color: #212529;
}

.karar-preview-modal .modal-header {
    border-bottom: 1px solid #eef2f7;
}

.karar-preview-modal .modal-body {
    background: #fff;
}

.karar-modal-side {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 1rem;
}

.karar-metni-popup {
    cursor: pointer;
}

.karar-metni-popup:hover {
    color: var(--kmtso-blue) !important;
    text-decoration: underline !important;
}

.karar-modal-loading {
    opacity: 0.65;
    pointer-events: none;
}

.badge-durum {
    font-weight: 500;
    padding: 0.45em 0.7em;
}

.search-bar {
    max-width: 280px;
}

.activity-item {
    border-left: 3px solid #1e5aa8;
    padding-left: 12px;
    margin-bottom: 14px;
}

.activity-item .meta {
    color: #6c757d;
    font-size: 0.85rem;
}

.activity-scroll {
    max-height: 520px;
    overflow-y: auto;
}

.nav-tabs-detail .nav-link { color: #495057; }
.nav-tabs-detail .nav-link.active { font-weight: 600; color: #1e5aa8; }

.detail-label {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    margin-bottom: 1rem;
}

.text-preview {
    white-space: pre-wrap;
}

.page-actions .btn {
    margin-left: 6px;
}

@media (max-width: 768px) {
    .search-bar {
        max-width: 100%;
    }
}

/* Mobil karar arama (Yönetim Kurulu) */
.mobile-app-body {
    background: #f0f4f8;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--kmtso-blue, #1e3a5f);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding-top: env(safe-area-inset-top, 0);
}

.mobile-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    max-width: 720px;
    margin: 0 auto;
}

.mobile-topbar-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}

.mobile-topbar-user {
    display: block;
    opacity: 0.85;
    font-size: 0.78rem;
}

.mobile-logout-btn {
    flex-shrink: 0;
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.mobile-logout-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: #fff;
}

.mobile-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 24px;
}

.mobile-search-panel {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px;
    position: sticky;
    top: 56px;
    z-index: 1020;
}

.mobile-search-input .form-control {
    border-radius: 10px 0 0 10px;
    font-size: 1rem;
}

.mobile-search-input .btn {
    border-radius: 0 10px 10px 0;
    padding-left: 16px;
    padding-right: 16px;
}

.mobile-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.mobile-filter-row .form-select {
    flex: 1 1 120px;
    min-width: 0;
}

.mobile-result-count {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #64748b;
}

.mobile-karar-list {
    padding: 12px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-karar-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-karar-card:active {
    border-color: #1e5aa8;
    box-shadow: 0 4px 12px rgba(30, 90, 168, 0.15);
}

.mobile-karar-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.mobile-karar-no {
    display: block;
    font-weight: 700;
    color: #1e3a5f;
    font-size: 1.05rem;
}

.mobile-karar-top {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.mobile-karar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 8px;
}

.mobile-karar-key {
    font-size: 0.82rem;
    color: #1e5aa8;
    background: #eff6ff;
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 8px;
    word-break: break-word;
}

.mobile-karar-text {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-karar-tap-hint {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.mobile-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
}

.mobile-pagination {
    padding: 16px 12px;
}

.mobile-pagination .pagination {
    justify-content: center !important;
    flex-wrap: wrap;
}

.mobile-detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
}

.mobile-karar-detail {
    background: #fff;
    margin: 0 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px;
}

.mobile-karar-detail-head {
    margin-bottom: 16px;
}

.mobile-karar-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 10px;
}

.mobile-karar-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mobile-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}

.mobile-detail-grid dt {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}

.mobile-detail-grid dd {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
}

.mobile-detail-section {
    margin-bottom: 18px;
}

.mobile-detail-section h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
}

.mobile-detail-section p,
.mobile-detail-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.mobile-app-body .karar-preview-modal .modal-header {
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0));
}

.mobile-app-body .karar-modal-readonly {
    font-size: 0.95rem;
}

@media (min-width: 721px) {
    .mobile-app-body .mobile-main {
        padding-top: 8px;
    }
}
