/* AmpleSoft Font Family */
@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Regular.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Medium.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft%20Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Medium.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft%20Medium.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Bold.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft%20Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Bold.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft%20Bold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AmpleSoft';
    src: url('../fonts/amplesoft/AmpleSoft-Light.otf') format('opentype'),
         url('../fonts/amplesoft/AmpleSoft%20Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    font-family: 'AmpleSoft', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    background: #fbfbfb;
    font-synthesis: none;
    font-optical-sizing: auto;
    font-weight: 400;
    
    /* Amanindo Corporate Orange Palette */
    --orange: #ed830f;
    --orange-deep: #d26e04;
    --orange-soft: #fff4e6;
    --orange-subtle: #fff8f0;
    --orange-border: #fed7aa;
    --orange-glow: rgba(237, 131, 15, 0.25);
    
    --green: #ed830f;
    --deep: #d26e04;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #edebe7;
    --panel: #ffffff;
    --soft: #fcfbfa;
    --amber: #ed830f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-page {
    background: #f9f8f6;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--line);
    padding: 24px 15px 17px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 1px 9px 30px;
    color: inherit;
    text-decoration: none;
}

.brand b {
    font-weight: 700;
    font-size: 16px;
    display: block;
    color: #111827;
    letter-spacing: -0.3px;
}

.brand small {
    display: block;
    color: var(--orange);
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.brand-mark {
    display: none;
}

.side-label, .eyebrow {
    color: var(--orange);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.side-label {
    padding: 0 11px 12px;
}

.department-nav {
    display: grid;
    gap: 5px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    text-align: left;
    border: 0;
    background: transparent;
    color: #4b5563;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
    background: var(--orange-subtle);
    color: var(--orange-deep);
}

.nav-item.active {
    background: var(--orange-soft);
    color: var(--orange-deep);
    font-weight: 700;
}

.nav-icon {
    height: 15px;
    width: 18px;
    position: relative;
    flex: 0 0 18px;
}

.nav-icon:before {
    content: '';
    position: absolute;
    left: 1px;
    top: 5px;
    width: 14px;
    height: 9px;
    border: 1.6px solid var(--orange);
    border-radius: 2px;
}

.nav-icon:after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 6px;
    height: 3px;
    border: 1.6px solid var(--orange);
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
}

.nav-count {
    margin-left: auto;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 17px 6px 0;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--orange-soft);
    color: var(--orange-deep);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--orange-border);
}

.profile-copy {
    min-width: 0;
}

.profile-copy b, .profile-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy b {
    font-size: 12.5px;
    font-weight: 600;
    color: #1f2937;
}

.profile-copy small {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.logout-button {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    padding: 6px 0;
    font-weight: 500;
    transition: color 0.15s;
}

.logout-button:hover {
    color: #dc2626;
}

.workspace {
    min-width: 0;
    flex: 1;
}

.topbar {
    height: 66px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 42px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.secure-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-border);
}

.mobile-brand {
    display: none;
}

.content {
    max-width: 1240px;
    margin: auto;
    padding: 40px 48px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 27px;
}

.eyebrow {
    margin: 0 0 8px;
}

.page-heading h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    color: #111827;
}

.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    margin: 6px 0 0;
}

.file-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.file-toolbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 21px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.crumb {
    border: 0;
    background: none;
    padding: 4px 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.crumb:hover {
    color: var(--orange);
}

.crumb.current {
    color: #111827;
    font-weight: 700;
}

.crumb-sep {
    font-size: 11px;
    color: #9ca3af;
}

.toolbar-actions {
    display: flex;
    gap: 9px;
    flex-shrink: 0;
}

.button {
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.button.primary {
    background: var(--orange);
    color: #ffffff;
    box-shadow: 0 3px 10px var(--orange-glow);
}

.button.primary:hover {
    background: var(--orange-deep);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px var(--orange-glow);
}

.button.secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.button.secondary:hover {
    background: var(--orange-subtle);
    border-color: var(--orange-border);
    color: var(--orange-deep);
}

/* Perfect alignment grid table */
.list-heading, .file-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 140px 90px 65px minmax(210px, auto);
    align-items: center;
    gap: 12px;
}

.list-heading {
    padding: 12px 21px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--line);
    background: #fafaf9;
    text-transform: uppercase;
}

.file-row {
    min-height: 66px;
    padding: 10px 21px;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s;
}

.file-row:last-child {
    border-bottom: 0;
}

.file-row:hover {
    background: #faf9f6;
}

.item-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.item-icon {
    height: 38px;
    width: 38px;
    border-radius: 9px;
    background: var(--orange-soft);
    color: var(--orange);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid var(--orange-border);
}

.item-icon.folder-icon {
    position: relative;
}

.item-icon.folder-icon:before {
    content: '';
    width: 17px;
    height: 12px;
    border: 1.8px solid var(--orange);
    border-radius: 2px;
    position: absolute;
    top: 13px;
    left: 10px;
}

.item-icon.folder-icon:after {
    content: '';
    width: 8px;
    height: 3px;
    border: 1.8px solid var(--orange);
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    position: absolute;
    top: 10px;
    left: 11px;
}

.item-icon.file-pdf {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.item-icon.file-word {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.item-icon.file-sheet {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.item-icon.file-image {
    background: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}

.item-copy {
    min-width: 0;
}

.item-title {
    display: block;
    border: 0;
    background: none;
    padding: 0;
    color: #111827;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.item-title.open-folder:hover {
    color: var(--orange);
}

.item-subtitle {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.row-meta {
    font-size: 12px;
    color: #4b5563;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.icon-button {
    width: auto;
    height: auto;
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    transition: all 0.15s;
}

.icon-button:hover {
    background: var(--orange-soft);
    color: var(--orange-deep);
}

.icon-button.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.empty-state, .loading-state {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 13px;
    gap: 8px;
}

.empty-state b {
    font-size: 15px;
    color: #1f2937;
}

.empty-icon {
    font-size: 32px;
    color: var(--orange);
    margin-bottom: 4px;
}

.page-note {
    font-size: 11.5px;
    color: #9ca3af;
    text-align: right;
    margin-top: 14px;
}

.notice {
    display: none;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 9px;
    background: var(--orange-soft);
    color: var(--orange-deep);
    border: 1px solid var(--orange-border);
    font-size: 13px;
    font-weight: 500;
}

.notice.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.notice.visible {
    display: block;
}

.action-dialog {
    border: 0;
    border-radius: 14px;
    width: min(440px, calc(100% - 30px));
    padding: 26px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    background: #ffffff;
}

.action-dialog::backdrop {
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
}

.action-dialog h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.dialog-close {
    position: absolute;
    right: 16px;
    top: 14px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    cursor: pointer;
}

.dialog-close:hover {
    color: #111827;
}

.dialog-field {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    margin-top: 19px;
}

.dialog-field input, .dialog-field select, .login-form input {
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    padding: 11px 13px;
    color: var(--ink);
    outline: none;
    font-size: 13.5px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dialog-field input:focus, .dialog-field select:focus, .login-form input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.version-list {
    display: grid;
    gap: 9px;
    margin-top: 19px;
}

.version-entry {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.version-entry b {
    display: block;
    color: #111827;
}

.version-entry small {
    color: var(--muted);
    display: block;
    margin-top: 5px;
}

.version-tag {
    align-self: center;
    background: var(--orange-soft);
    color: var(--orange-deep);
    border: 1px solid var(--orange-border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10.5px;
    font-weight: 700;
}

/* ========================================================
   LOGIN PAGE (Amanindo Brand Orange)
======================================================== */
.login-page {
    background: radial-gradient(ellipse at 12% 15%, #ffe6cc 0%, transparent 45%),
                radial-gradient(ellipse at 88% 88%, #ffeedd 0%, transparent 42%),
                #faf8f5;
    display: grid;
    place-items: center;
    padding: 24px;
    min-height: 100vh;
}

.login-card {
    width: min(420px, 100%);
    background: #ffffff;
    border: 1px solid #f1eae1;
    border-radius: 16px;
    box-shadow: 0 18px 65px rgba(210, 110, 4, 0.08);
    padding: 38px 36px;
}

.login-card .eyebrow {
    color: var(--orange);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    margin: 0 0 8px;
}

.login-card h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.4px;
    color: #111827;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 12.5px;
    font-weight: 600;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
}

.password-toggle:hover {
    color: var(--orange);
    background: var(--orange-subtle);
}

.full {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    font-size: 14px;
}

.demo-note {
    display: grid;
    gap: 5px;
    background: var(--orange-subtle);
    border: 1px solid var(--orange-border);
    border-radius: 9px;
    margin-top: 18px;
    padding: 12px;
    color: #7c2d12;
    font-size: 11.5px;
    line-height: 1.5;
}

.demo-note strong {
    font-size: 11.5px;
    color: var(--orange-deep);
}

.login-foot {
    color: #9ca3af;
    font-size: 11px;
    text-align: center;
    margin: 22px 0 0;
}

.alert {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 12.5px;
    margin-top: 18px;
    font-weight: 500;
}

/* ========================================================
   PREVIEW DIALOG
======================================================== */
.preview-dialog {
    border: 0;
    border-radius: 14px;
    width: min(1000px, calc(100% - 30px));
    height: min(90vh, 850px);
    padding: 25px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    background: #ffffff;
}

.preview-dialog::backdrop {
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
}

.preview-dialog h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111827;
}

.preview-content {
    height: calc(100% - 120px);
    min-height: 250px;
    background: #f3f4f6;
    border-radius: 9px;
    overflow: auto;
    display: grid;
    place-items: center;
}

.preview-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-dialog form {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-dialog .dialog-actions {
    margin-top: 12px;
}

[hidden] {
    display: none !important;
}

/* Responsive */
@media (max-width: 950px) {
    .sidebar { width: 210px; }
    .content { padding: 34px 25px; }
    .topbar { padding: 0 25px; }
    .list-heading, .file-row {
        grid-template-columns: minmax(160px, 1fr) 120px 75px 50px auto;
        gap: 8px;
    }
    .file-row, .list-heading {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 700px) {
    .sidebar {
        width: 67px;
        padding: 18px 9px;
    }
    .brand { padding: 0 6px 29px; }
    .brand > span:last-child,
    .side-label,
    .nav-item span:not(.nav-icon),
    .sidebar-bottom .profile-copy,
    .logout-button {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px 0;
    }
    .nav-icon { font-size: 17px; }
    .sidebar-bottom { padding: 15px 0 0; }
    .profile { justify-content: center; }
    .topbar {
        height: 57px;
        padding: 0 17px;
        justify-content: space-between;
    }
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #111827;
    }
    .mobile-brand b {
        color: var(--orange);
    }
    .topbar-right { font-size: 10.5px; }
    .content { padding: 26px 14px; }
    .page-heading h1 { font-size: 22px; }
    .page-heading { margin-bottom: 20px; }
    .file-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 13px;
    }
    .toolbar-actions { width: 100%; }
    .toolbar-actions .button {
        flex: 1;
        padding: 9px 7px;
        font-size: 11px;
    }
    .list-heading { display: none; }
    .file-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
        padding: 12px 13px;
    }
    .item-name { grid-column: 1; }
    .row-actions { grid-column: 2; grid-row: 1; }
    .row-meta {
        grid-column: 1 / -1;
        padding-left: 50px;
        font-size: 10px;
    }
    .crumb { font-size: 11px; }
    .file-panel { border-radius: 10px; }
    .login-card { padding: 28px 20px; }
}
